zeroxkey_crypto library

Functions

decryptCredentialBundle({required String credentialBundle, required String embeddedKey}) String
Decrypts an encrypted email authentication/recovery or OAuth credential bundle.
decryptExportBundle({required String exportBundle, required String embeddedKey, required String organizationId, String? dangerouslyOverrideSignerPublicKey, String keyFormat = 'HEXADECIMAL', bool returnMnemonic = false}) Future<String>
Decrypts an encrypted export bundle (such as a private key or wallet account bundle).
encryptOtpCodeToBundle({required String otpCode, required String otpEncryptionTargetBundle, required String publicKey, String? dangerouslyOverrideSignerPublicKey}) Future<String>
Encrypts an OTP code and a client public key to the target encryption key provided by the enclave during initOtp. The resulting encrypted bundle is sent to verifyOtpV2 so the enclave can decrypt it, verify the OTP code, and issue a verification token bound to the client's public key.
encryptPrivateKeyToBundle({required String privateKey, required String keyFormat, required String importBundle, required String userId, required String organizationId, String? dangerouslyOverrideSignerPublicKey}) Future<String>
Encrypts a private key bundle using HPKE and verifies the enclave signature.
encryptWalletToBundle({required String mnemonic, required String importBundle, required String userId, required String organizationId, String? dangerouslyOverrideSignerPublicKey}) Future<String>
Encrypts a mnemonic wallet bundle using HPKE and verifies the enclave signature.
fromDerSignature(String derSignature) Uint8List
Converts a DER-encoded ECDSA signature into a normalized Uint8List format with 32-byte r and s components concatenated.
generateP256KeyPair() → KeyPair
Generates a P-256 key pair.
getPublicKey(dynamic privateKey, {bool isCompressed = true}) Uint8List
Derives the public key from a private key using the P-256 curve.