locksmith library

Locksmith — cross-platform cryptography facade for Dart and Flutter.

Functions

buildEnvelopeJson(Envelope envelope) → Uint8List
buildPortablePackJson(PortablePack pack) → List<int>
buildRsaPrivateKeyPkcs1Der(RsaKeyMaterial material) → List<int>
buildRsaPrivateKeyPkcs8Der(RsaKeyMaterial material) → List<int>
buildRsaPublicKeyPkcs1Der(RsaKeyMaterial material) → List<int>
buildRsaPublicKeySpkiDer(RsaKeyMaterial material) → List<int>
buildSymmetricEnvelopeJson(SymmetricEnvelope envelope) → Uint8List
buildSymmetricPortablePackJson(SymmetricPortablePack pack) → List<int>
crossPlatformHarnessPlatformId() → String
currentPlatformBackendId() → String?
Returns the native keystore backend id for the current platform, or null.
defaultKeyGenerationOptions(String alias) → KeyGenerationOptions
defaultKeyStorePath({KeyStorePathResolver? resolver}) → String
Resolves the canonical default keystore directory for the current platform.
defaultKeyUsageSet() → Set<KeyUsage>
encryptionAlgorithmName(EncryptionAlgorithm algorithm) → String
ensureMinimumKeySize(RsaKeyMaterial key) → void
extractPkcs1PrivateKeyDer(List<int> der) → List<int>
fileStoreName(String localPath) → String
generateRsaKeyPair(KeyStore store, String alias) → Future<GeneratedKeyPair>
getCryptoProvider() → CryptoProvider
hashAlgorithmName(HashAlgorithm algorithm) → String
importRsaKeyPairFromPem(KeyStore store, String alias, String privateKeyPem, String publicKeyPem) → Future<GeneratedKeyPair>
isEnvelopeBytes(List<int> data) → bool
isEphemeralStoreName(String storeName) → bool
isFileStoreName(String storeName) → bool
isPlatformStoreName(String storeName) → bool
isPortablePackBytes(List<int> data) → bool
isSymmetricEnvelopeBytes(List<int> data) → bool
isSymmetricPortablePackBytes(List<int> data) → bool
keyIdFromAlias(String alias) → String
keyRefEquals(KeyRef left, KeyRef right) → bool
keyRefIsEmpty(KeyRef ref) → bool
keyRefRequiresNativePrivateOp(KeyRef ref) → bool
keyRefValidateProvider(KeyRef ref, String providerName) → void
localPathFromStoreName(String storeName) → String
minimumRsaKeyBits(RsaKeyMaterial key) → int
normalizeSymmetricKey(List<int> key) → List<int>
parseEnvelopeJson(List<int> data) → Envelope
parsePortablePackJson(List<int> data) → PortablePack
parsePrivateKeyDer(List<int> der) → PrivateKey
parsePrivateKeyPem(String pem) → PrivateKey
parsePublicKeyDer(List<int> der) → PublicKey
parsePublicKeyPem(String pem) → PublicKey
parseRsaPrivateKeyDer(List<int> der) → RsaKeyMaterial
parseSubjectPublicKeyInfo(List<int> der) → RsaKeyMaterial
parseSymmetricEnvelopeJson(List<int> data) → SymmetricEnvelope
parseSymmetricPortablePackJson(List<int> data) → SymmetricPortablePack
platformBackendIdFromStoreName(String storeName) → String
platformStoreName(String backendId) → String
portablePackEnvelopeBytesForSigning(PortablePack pack) → List<int>
privateKeyToPem(PrivateKey key) → String
publicKeyToPem(PublicKey key) → String
raiseInvalidEnvelope(String message) → Never
raiseInvalidKey(String message) → Never
raiseInvalidState(String message) → Never
raiseProviderError({required String providerName, required String operation, required String detail, int nativeCode = 0}) → Never
raiseUnsupportedAlgorithm(String algorithm) → Never
requirePlatformBackendStoreName() → String
Resolves KeyStorageBackend.platform to a registered store name.
resetCryptoProvider() → void
resolveCrossPlatformFixtureDir({String cliFixtureDir = ''}) → String
resolveEncryptionAlgorithm(EncryptionAlgorithm algorithm) → EncryptionAlgorithm
resolveHashAlgorithm(HashAlgorithm algorithm) → HashAlgorithm
resolveKeyGenerationOptions(KeyGenerationOptions options) → KeyGenerationOptions
resolveSignatureAlgorithm(SignatureAlgorithm algorithm) → SignatureAlgorithm
resolveSymmetricEncryptionAlgorithm(EncryptionAlgorithm algorithm) → EncryptionAlgorithm
rsaModulusBitLength(List<int> modulus) → int
runCrossPlatformHarness(String fixtureDir) → Future<String>
setCryptoProvider(CryptoProvider provider) → void
signatureAlgorithmName(SignatureAlgorithm algorithm) → String
stripPemEnvelope(String pem, String beginMarker, String endMarker) → String
symmetricDecryptEnvelope(List<int> key, List<int> cipher, AesGcmDecryptFn decrypt) → List<int>
symmetricEncryptEnvelope(List<int> key, List<int> plain, AesGcmEncryptFn encrypt, RandomBytesFn randomBytes, {String keyId = ''}) → Uint8List
tryParsePkcs8PrivateKey(List<int> der, PrivateKey key) → bool
wrapPem64(String header, String footer, String base64Body) → String

Typedefs

AesGcmDecryptFn = List<int> Function(List<int> key, List<int> nonce, List<int> cipher, List<int> tag, List<int> aad)
AesGcmEncryptFn = List<int> Function(List<int> key, List<int> nonce, List<int> cipher, List<int> tag, List<int> aad)
KeyStorePathResolverFn = String Function()
RandomBytesFn = List<int> Function(int count)