CryptoBackend class abstract

Crypto primitive backend abstraction.

TLS 1.3 and QUIC packet protection need AES-GCM, ChaCha20-Poly1305, HKDF, X25519, and Ed25519. This interface lets quic_lib swap between package:cryptography, package:pointycastle, and future backends without rewriting protocol logic.

Implementers

Constructors

CryptoBackend()

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
Human-readable backend name (e.g. 'cryptography', 'pointycastle').
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

aeadDecrypt(AeadAlgorithm aead, SecretKey key, List<int> nonce, List<int> ciphertext, {List<int>? associatedData}) Future<List<int>>
AEAD decrypt. Returns plaintext or throws a decryption error.
aeadEncrypt(AeadAlgorithm aead, SecretKey key, List<int> nonce, List<int> plaintext, {List<int>? associatedData}) Future<AeadResult>
AEAD encrypt. Returns ciphertext + tag.
ecdsaP256GenerateKeyPair() Future<KeyPair>
Generates a new ECDSA P-256 key pair.
ecdsaP256Sign(SecretKey privateKey, List<int> message) Future<List<int>>
Signs message with the ECDSA P-256 private key using SHA-256.
ecdsaP256Verify(PublicKey publicKey, List<int> message, List<int> signature) Future<bool>
Verifies an ECDSA P-256 signature using SHA-256.
ed25519GenerateKeyPair() Future<KeyPair>
Generates a new Ed25519 key pair.
ed25519Sign(SecretKey privateKey, List<int> message) Future<List<int>>
Signs message with the Ed25519 private key.
ed25519Verify(PublicKey publicKey, List<int> message, List<int> signature) Future<bool>
Verifies an Ed25519 signature.
hkdfExpand(HashAlgorithm hash, SecretKey prk, List<int> info, int length) Future<List<int>>
HKDF-Expand.
hkdfExpandLabel(HashAlgorithm hash, SecretKey secret, String label, List<int> context, int length) Future<List<int>>
HKDF-Expand-Label with the TLS 1.3 label prefix.
hkdfExtract(HashAlgorithm hash, SecretKey salt, SecretKey ikm) Future<SecretKey>
HKDF-Extract.
hmac(HashAlgorithm hash, SecretKey key, List<int> data) Future<List<int>>
Computes HMAC with the given hash algorithm.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
randomBytes(int length) Future<List<int>>
Generates length cryptographically secure random bytes.
rsaPkcs1Verify(PublicKey publicKey, HashAlgorithm hash, List<int> message, List<int> signature) Future<bool>
Verifies an RSASSA-PKCS1-v1_5 signature using the given hash.
sha256(List<int> data) Future<List<int>>
Computes a SHA-256 digest.
sha384(List<int> data) Future<List<int>>
Computes a SHA-384 digest.
supportedCipherSuites() List<String>
Lists the TLS 1.3 cipher suites this backend can service.
toString() String
A string representation of this object.
inherited
x25519GenerateKeyPair() Future<KeyPair>
Generates a new X25519 key pair.
x25519SharedSecret(SecretKey privateKey, PublicKey publicKey) Future<SecretKey>
Performs X25519 ECDH.

Operators

operator ==(Object other) bool
The equality operator.
inherited