OpenSSL class
The main entry point: one loaded instance of the OpenSSL library.
Functionality is aggregated through mixins — digests and keys
(CryptoMixin), ciphers, X.509, CMS, OCSP, PKCS, time-stamping and the
rest — so everything hangs off a single object:
final openSsl = OpenSSL();
final hash = openSsl.digestHex('sha256', bytes);
One instance per isolate
An OpenSSL instance cannot cross an isolate boundary, and neither can
anything holding a handle from it — EvpPkey, X509Certificate,
EvpDigest, and so on. The instance owns a DynamicLibrary and raw
pointers, which are not sendable and are only valid in the isolate that
created them. Sending one fails at runtime with:
Invalid argument(s): Illegal argument in isolate message:
(object is a DynamicLibrary)
So every isolate that needs OpenSSL builds its own instance. Within an isolate, one instance is safe to share across concurrent operations: each call allocates its own context and frees it before returning, and the instance itself only holds the loaded library's function pointers. Keeping one per isolate — rather than one per call — is the right shape:
// In a long-lived worker isolate:
final openSsl = OpenSSL(); // once, for the isolate's lifetime
await for (final job in inbox) { … } // shared by every job
The trap is doing it by accident. A closure passed to Isolate.run carries
its entire captured context, including parent scopes it never reads, so
writing the closure anywhere an OpenSSL variable is in scope drags the
instance along and the spawn fails. Hoist the work into a top-level function
whose scope holds only sendable data:
// Wrong: captures `openSsl` from the enclosing scope, even unused.
final openSsl = OpenSSL();
await Isolate.run(() => OpenSSL().digestHex('sha256', data)); // throws
// Right: a top-level function, nothing but sendable data in scope.
Future<String> hashInIsolate(Uint8List data) =>
Isolate.run(() => OpenSSL().digestHex('sha256', data));
Cost of loading
Building an instance loads libcrypto/libssl, so a short-lived isolate pays that on every spawn. For small inputs — a few kilobytes — that load can cost more than the hashing it enables, and a pure-Dart implementation may well win. The native advantage shows up on large inputs and on long-lived isolates that amortise the load. Measure before moving small, hot, per-spawn work onto OpenSSL.
See test/concurrency/multi_isolate_stress_test.dart, which pins all of the
above against a multi-isolate workload.
- Inheritance
-
- Object
- OpenSslContext
- OpenSSL
- Mixed-in types
Properties
- bindings → OpenSslFfi
-
Acesso aos bindings brutos gerados.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasNativeArgon2 → bool
-
Whether the loaded libcrypto offers native Argon2 (OpenSSL 3.2+).
no setterinherited
-
loadedProviders
→ Map<
String, OpenSslProvider> -
Providers loaded so far (unmodifiable).
no setterinherited
- loader → OpenSslBindings
-
Acesso ao loader/configuração (opcional, se precisarmos de caminhos).
no setteroverride
- opensslVersionMajor → int
-
OpenSSL version (major).
no setter
- opensslVersionMinor → int
-
OpenSSL version (minor).
no setter
- opensslVersionPatch → int
-
OpenSSL version (patch).
no setter
- opensslVersionString → String
-
OpenSSL version string (major.minor.patch).
no setter
- providerSearchPath → String?
-
Provider search directory in use, or
nullwhen it is the built-in one.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
aes128CbcDecrypt(
{required Uint8List ciphertext, required Uint8List key, required Uint8List iv}) → Uint8List -
Decrypts
ciphertextusing AES-128-CBC with PKCS#7 padding.inherited -
aes128CbcEncrypt(
{required Uint8List data, required Uint8List key, required Uint8List iv}) → Uint8List -
Encrypts
datausing AES-128-CBC with PKCS#7 padding.inherited -
aes128GcmDecrypt(
{required Uint8List ciphertext, required Uint8List key, required Uint8List iv, required Uint8List tag, Uint8List? aad}) → Uint8List -
Decrypts
ciphertextusing AES-128-GCM.inherited -
aes128GcmEncrypt(
{required Uint8List data, required Uint8List key, required Uint8List iv, Uint8List? aad}) → Map< String, Uint8List> -
Encrypts
datausing AES-128-GCM.inherited -
aes256CbcDecrypt(
{required Uint8List ciphertext, required Uint8List key, required Uint8List iv}) → Uint8List -
Decrypts
ciphertextusing AES-256-CBC with PKCS#7 padding.inherited -
aes256CbcEncrypt(
{required Uint8List data, required Uint8List key, required Uint8List iv}) → Uint8List -
Encrypts
datausing AES-256-CBC with PKCS#7 padding.inherited -
aes256GcmDecrypt(
{required Uint8List ciphertext, required Uint8List key, required Uint8List iv, required Uint8List tag, Uint8List? aad}) → Uint8List -
Decrypts
ciphertextusing AES-256-GCM. Throws OpenSslException if authentication fails (Tag mismatch).inherited -
aes256GcmEncrypt(
{required Uint8List data, required Uint8List key, required Uint8List iv, Uint8List? aad}) → Map< String, Uint8List> -
Encrypts
datausing AES-256-GCM.inherited -
aesCbcPkcs7Decrypt(
{required Uint8List ciphertext, required Uint8List key, required Uint8List iv}) → Uint8List -
Convenience helper that decrypts using AES-CBC with PKCS#7 padding.
inherited
-
aesCbcPkcs7Encrypt(
{required Uint8List data, required Uint8List key, required Uint8List iv}) → Uint8List -
Convenience helper that encrypts using AES-CBC with PKCS#7 padding.
inherited
-
argon2Derive(
Uint8List password, Uint8List salt, {Argon2Options options = const Argon2Options(), Argon2Backend? backend}) → Uint8List -
Derives
options.length bytes frompasswordandsalt.inherited -
argon2DeriveFromString(
String password, Uint8List salt, {Argon2Options options = const Argon2Options(), Argon2Backend? backend}) → Uint8List -
Same as argon2Derive, taking the password as a UTF-8 string.
inherited
-
argon2HashPassword(
String password, {Argon2Options options = const Argon2Options(), Uint8List? salt, Argon2Backend? backend}) → String -
Hashes
passwordand encodes the result as a PHC string, the format$argon2id$v=19$m=65536,t=3,p=1$<salt>$<hash>used by most password databases.inherited -
argon2VerifyPassword(
String phc, String password, {Uint8List? secret, Uint8List? associatedData, Argon2Backend? backend}) → bool -
Checks
passwordagainst a PHC string produced by argon2HashPassword.inherited -
asn1IntegerFromHex(
String hex) → Pointer< ASN1_INTEGER> -
Converts hexadecimal string to ASN1_INTEGER through BIGNUM.
inherited
-
asn1IntegerToDecimal(
Pointer< ASN1_INTEGER> value) → String -
Converts ASN1_INTEGER to decimal string via BIGNUM.
inherited
-
asn1IntegerToHex(
Pointer< ASN1_INTEGER> value) → String -
Converts ASN1_INTEGER to hexadecimal string via BIGNUM.
inherited
-
bioToString(
Pointer< BIO> bio) → String -
Lê todo o conteúdo de um BIO para String.
inherited
-
buildOcspRequest(
{required X509Certificate certificate, required X509Certificate issuerCertificate, String hashAlgorithm = 'SHA1', int? nonceLength}) → Uint8List -
Builds a DER-encoded OCSP request for
certificate/issuerCertificate.inherited -
buildOcspResponse(
{required Uint8List requestDer, required Map< String, OcspStatusInfo> statusBySerial, required X509Certificate responderCertificate, required EvpPkey responderKey, List<X509Certificate> ? extraCertificates, String hashAlgorithm = 'SHA256', DateTime? defaultThisUpdate, DateTime? defaultNextUpdate, bool includeNonce = true, OcspNoncePolicy? noncePolicy, bool responderIdByKey = false}) → Uint8List -
Builds a DER-encoded OCSP response for the given request.
inherited
-
buildTimestampRequest(
{required Uint8List hash, String hashAlgorithm = 'SHA256', String? policyOid, bool requestCertificate = true, bool useNonce = true, BigInt? nonce}) → TimestampRequest -
Builds a
TimeStampReqforhash.inherited -
buildTimestampRequestForData(
Uint8List data, {String hashAlgorithm = 'SHA256', String? policyOid, bool requestCertificate = true}) → TimestampRequest -
Convenience for the common case: hash
data, ask the TSA and return the request to post.inherited -
certMatchesIssuer(
{Uint8List? childAki, Uint8List? issuerSki, Uint8List? issuerSerialBytes, String? issuerNameHash}) → bool -
Pre-filter for issuer candidates based on AKI/SKI + serial/name hints.
inherited
-
chacha20Decrypt(
{required Uint8List ciphertext, required Uint8List key, required Uint8List iv}) → Uint8List -
Decrypts
ciphertextusing ChaCha20 (stream cipher).inherited -
chacha20Encrypt(
{required Uint8List data, required Uint8List key, required Uint8List iv}) → Uint8List -
Encrypts
datausing ChaCha20 (stream cipher).inherited -
chacha20Poly1305Decrypt(
{required Uint8List ciphertext, required Uint8List key, required Uint8List iv, required Uint8List tag, Uint8List? aad}) → Uint8List -
Decrypts
ciphertextusing ChaCha20-Poly1305 (AEAD).inherited -
chacha20Poly1305Encrypt(
{required Uint8List data, required Uint8List key, required Uint8List iv, Uint8List? aad}) → Map< String, Uint8List> -
Encrypts
datausing ChaCha20-Poly1305 (AEAD).inherited -
Computes shared secret (ECDH) between
privateKeyandpeerPublicKey.inherited -
convertCertificateDerToPem(
Uint8List der) → String -
Converts a DER certificate into PEM string.
inherited
-
convertCertificatePemToDer(
String pem) → Uint8List -
Converts a PEM certificate into DER bytes.
inherited
-
convertPemChainToDerList(
String pemChain) → List< Uint8List> -
Converts a PEM chain string into a list of DER-encoded certificates.
inherited
-
createBio(
) → Pointer< BIO> -
Cria um BIO vazio (Writable).
inherited
-
createBioFromString(
String text) → Pointer< BIO> -
Cria um BIO a partir de uma String.
inherited
-
createCertificate(
) → X509Certificate -
Creates a new empty X509 Certificate structure.
Useful for building new certificates.
inherited
-
createCrossCertificate(
{required X509Certificate subjectCert, required EvpPkey subjectKeyPair, required X509Certificate issuerCert, required EvpPkey issuerKeyPair, int? serialNumber, BigInt? serialNumberBigInt, int notBeforeOffset = 0, int notAfterOffset = _defaultCaValiditySeconds, int? pathLen, bool basicConstraintsCritical = true, bool keyUsageKeyCertSign = true, bool keyUsageCrlSign = true, bool keyUsageCritical = true, String hashAlgorithm = 'SHA256'}) → Uint8List -
Creates a cross certificate for CA rollover.
inherited
-
createPkcs12(
{required EvpPkey privateKey, required X509Certificate certificate, List< X509Certificate> caCertificates = const [], String? password, String? friendlyName, int iterations = 2048, int macIterations = 2048}) → Uint8List -
Creates a PKCS#12/PFX bundle (DER) with key + certificate (+ optional chain).
inherited
-
createRolloverCrossCertificates(
{required X509Certificate oldCaCert, required EvpPkey oldCaKey, required X509Certificate newCaCert, required EvpPkey newCaKey, BigInt? oldSignedByNewSerial, BigInt? newSignedByOldSerial, int notBeforeOffset = 0, int notAfterOffset = _defaultCaValiditySeconds, int? pathLen, bool basicConstraintsCritical = true, bool keyUsageKeyCertSign = true, bool keyUsageCrlSign = true, bool keyUsageCritical = true, String hashAlgorithm = 'SHA256'}) → RolloverChain -
Creates the pair of cross certificates used during CA rollover.
inherited
-
createTimestampResponse(
{required Uint8List requestDer, required X509Certificate signerCertificate, required EvpPkey signerKey, required String defaultPolicyOid, BigInt? serialNumber, List< String> acceptedDigests = const ['SHA256', 'SHA384', 'SHA512'], List<String> acceptedPolicyOids = const [], List<X509Certificate> chain = const [], TimestampAccuracy? accuracy, int clockPrecisionDigits = 0, bool ordering = false, String signerDigest = 'SHA256'}) → Uint8List -
Issues a
TimeStampRespforrequestDer— the TSA side of RFC 3161.inherited -
createUserCertificate(
{required EvpPkey keyPair, required EvpPkey issuerKeyPair, required String subjectDn, required String issuerDn, int? serialNumber, BigInt? serialNumberBigInt, int notBeforeOffset = 0, int notAfterOffset = 31536000, bool isCa = false, int? pathLen, bool basicConstraintsCritical = true, bool keyUsageDigitalSignature = true, bool keyUsageNonRepudiation = false, bool keyUsageKeyEncipherment = true, bool keyUsageDataEncipherment = false, bool keyUsageKeyAgreement = false, bool keyUsageKeyCertSign = false, bool keyUsageCrlSign = false, bool keyUsageEncipherOnly = false, bool keyUsageDecipherOnly = false, bool keyUsageCritical = true, List< String> extendedKeyUsageOids = const [], String hashAlgorithm = 'SHA256'}) → Uint8List -
Creates a user certificate and returns DER bytes.
inherited
-
decodeCms(
Uint8List der) → CmsContent -
Decodes a DER CMS/PKCS#7 into a managed CmsContent wrapper.
inherited
-
digest(
String algorithmName, Uint8List data) → Uint8List -
Digests
datawithalgorithmName, as OpenSSL names it:sha256,sha512,sha3-256, … TheDigestAlgorithmconstants are these names with the spelling checked by the compiler, and go in the same place:digest(DigestAlgorithm.sha256, data).inherited -
digestFile(
String algorithmName, File file, {int bufferSize = EvpDigest.defaultBufferSize}) → Future< Uint8List> -
Digests
fileby reading it in chunks, never loading it whole.inherited -
digestHex(
String algorithmName, Uint8List data) → String -
Digests
dataand returns the result as lowercase hexadecimal.inherited -
digestStream(
String algorithmName, Stream< List< data, {int bufferSize = EvpDigest.defaultBufferSize}) → Future<int> >Uint8List> -
Digests everything
dataemits, without buffering the whole stream.inherited -
encodeAsn1Integer(
Pointer< ASN1_INTEGER> integer) → Uint8List -
Encode an ASN1_INTEGER to DER.
inherited
-
encodeCertificateDer(
X509Certificate cert) → Uint8List -
Encodes an X509 Certificate to DER bytes.
inherited
-
encodeCertificatePem(
X509Certificate cert) → String -
Encodes an X509 Certificate to PEM string.
inherited
-
encodeCms(
CmsContent cms) → Uint8List -
Encodes a CMS/PKCS#7 structure to DER.
inherited
-
encodeX509(
X509Certificate cert) → Uint8List -
Encode an X509 certificate to DER.
inherited
-
encodeX509Name(
Pointer< X509_NAME> name) → Uint8List -
Encode an X509_NAME to DER.
inherited
-
extractAkiSki(
Pointer< X509> cert) → ({Uint8List? aki, String issuerNameHash, Uint8List serialBytes, Uint8List? ski}) -
Parses AKI/SKI + issuer matching material from certificate.
inherited
-
extractIssuerAndSerialDer(
Uint8List certificateDer) → ({Uint8List issuerDer, Uint8List serialDer}) -
Extract issuer name (DER) and serial number (DER) from a certificate DER.
inherited
-
fingerprintSha256(
Uint8List data) → String -
SHA-256 fingerprint in lowercase hexadecimal.
inherited
-
freeBio(
Pointer< BIO> bio) → void -
Libera um BIO.
inherited
-
generateEc(
String curveName) → EvpPkey -
Gera um par de chaves EC (Elliptic Curve).
inherited
-
generateEd25519(
) → EvpPkey -
Generates an Ed25519 key pair.
inherited
-
generateEd448(
) → EvpPkey -
Generates an Ed448 key pair.
inherited
-
generateKeyByName(
String algorithmName, {Map< String, String> ? utf8Params}) → EvpPkey -
Generates a key pair by algorithm name supported by OpenSSL providers.
inherited
-
generateMlDsa44(
) → EvpPkey -
Generates an ML-DSA-44 key pair (if supported by the loaded OpenSSL).
inherited
-
generateMlDsa65(
) → EvpPkey -
Generates an ML-DSA-65 key pair (if supported by the loaded OpenSSL).
inherited
-
generateMlDsa87(
) → EvpPkey -
Generates an ML-DSA-87 key pair (if supported by the loaded OpenSSL).
inherited
-
generateRsa(
int bits) → EvpPkey -
Gera um par de chaves RSA.
inherited
-
generateSerialNumberBigInt(
{int bytes = 16}) → BigInt -
Generates a cryptographically strong random serial number.
inherited
-
generateX25519(
) → EvpPkey -
Generates an X25519 key pair.
inherited
-
generateX448(
) → EvpPkey -
Generates an X448 key pair.
inherited
-
getCachedCrl(
String key) → Uint8List? -
Optional CRL cache with TTL to avoid mass re-fetch.
inherited
-
getCachedOcsp(
String key) → Uint8List? -
Optional OCSP cache with TTL to avoid mass re-fetch.
inherited
-
getOrCreateParsedX509(
Uint8List der) → Pointer< X509> -
Returns cached parsed certificate pointer keyed by DER fingerprint.
inherited
-
getOrCreateStore(
String storeKey, List< Uint8List> rootsDer) → X509Store -
Returns a cached X509_STORE for a truststore fingerprint key.
inherited
-
hmac(
String algorithmName, Uint8List key, Uint8List data) → Uint8List -
HMAC of
dataunderkey, with the digestalgorithmNamenames —sha256,sha512, … or aDigestAlgorithmconstant, which is the same string with the spelling checked:hmac(DigestAlgorithm.sha256, key, data).inherited -
hmacHex(
String algorithmName, Uint8List key, Uint8List data) → String -
HMAC as lowercase hexadecimal:
hmacthrough encodeHex.inherited -
isProviderAvailable(
String name) → bool -
Whether the
nameprovider is available for use.inherited -
issuerSerialKey(
{required Uint8List issuerSerialBytes, required String issuerNameHash}) → String -
Stable key for maps/indexes keyed by issuer name hash + serial bytes.
inherited
-
keyRequiresOneShotSignature(
EvpPkey key) → bool -
Whether
keysigns the message directly and therefore rejects an external digest (Ed25519, Ed448 and the ML-DSA family).inherited -
loadCertificateBytes(
Uint8List bytes) → X509Certificate -
Loads an X509 Certificate from bytes (auto-detect PEM vs DER).
inherited
-
loadCertificateDer(
Uint8List der) → X509Certificate -
Loads an X509 Certificate from DER bytes.
inherited
-
loadCertificatePem(
String pem) → X509Certificate -
Loads an X509 Certificate from PEM string.
inherited
-
loadCertificatesFromPemChain(
String pemChain) → List< X509Certificate> -
Loads a list of certificates from a PEM chain string.
inherited
-
loadCertificatesFromPkcs7Bytes(
Uint8List bytes) → List< X509Certificate> -
Extracts certificates from PKCS#7 bytes (auto-detect PEM vs DER).
inherited
-
loadCertificatesFromPkcs7Der(
Uint8List der) → List< X509Certificate> -
Extracts certificates from a PKCS#7/CMS DER payload (.p7b).
inherited
-
loadCertificatesFromPkcs7Pem(
String pem) → List< X509Certificate> -
Extracts certificates from a PKCS#7/CMS PEM string (.p7b).
inherited
-
loadCrlBytes(
Uint8List bytes) → X509Crl -
Loads an X509 CRL from bytes (auto-detect PEM vs DER).
inherited
-
loadCrlDer(
Uint8List der) → X509Crl -
Loads an X509 CRL from DER bytes.
inherited
-
loadCrlPem(
String pem) → X509Crl -
Loads an X509 CRL from PEM string.
inherited
-
loadCsrBytes(
Uint8List bytes) → X509Request -
Loads a CSR from bytes (auto-detect PEM vs DER).
inherited
-
loadCsrDer(
Uint8List der) → X509Request -
Loads a CSR (PKCS#10) from DER bytes.
inherited
-
loadCsrPem(
String pem) → X509Request -
Loads a CSR (PKCS#10) from PEM string.
inherited
-
loadLegacyProvider(
{bool required = true, List< String> searchPaths = const []}) → OpenSslProvider? -
Loads the kLegacyProvider keeping
defaultactive.inherited -
loadPrivateKeyDer(
Uint8List der) → EvpPkey -
Loads a private key from DER — PKCS#8 or a traditional PKCS#1 key.
inherited
-
loadPrivateKeyJwk(
Map< String, Object?> jwk) → EvpPkey -
Loads an RSA private key from a JSON Web Key (RFC 7517).
inherited
-
loadPrivateKeyPem(
String pem, {String? password}) → EvpPkey -
Carrega uma Chave Privada de PEM, opcionalmente decifrando com
password.inherited -
loadProvider(
String name, {bool retainFallbacks = true, bool required = true, List< String> searchPaths = const [], bool searchModule = true}) → OpenSslProvider? -
Loads a provider into the library's default context.
inherited
-
loadPublicKeyBytes(
Uint8List bytes) → EvpPkey -
Loads a public key from DER or PEM, whichever
bytesholds.inherited -
loadPublicKeyDer(
Uint8List der) → EvpPkey -
Loads a public key from DER (SubjectPublicKeyInfo).
inherited
-
loadPublicKeyJwk(
Map< String, Object?> jwk) → EvpPkey -
Loads an RSA public key from a JSON Web Key (RFC 7517).
inherited
-
loadPublicKeyPem(
String pem) → EvpPkey -
Carrega um Chave Pública de PEM.
inherited
-
lookup<
T extends Function> (String name) → Pointer< NativeFunction< T> > -
Helper para pegar endereços de funções (para NativeFinalizer).
override
-
newCertificateBuilder(
) → X509CertificateBuilder -
Creates a new Builder for creating and signing X509 Certificates.
inherited
-
newCrlBuilder(
) → X509CrlBuilder -
Creates a new Builder for creating and signing X509 CRLs.
inherited
-
newCsrBuilder(
) → X509RequestBuilder -
Creates a new Builder for creating and signing CSRs.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parsePkcs12(
Uint8List der, {String password = '', bool legacy = false, bool autoLegacy = false}) → Pkcs12Bundle -
Parses PKCS#12/PFX (DER) and returns key, certificate and chain.
inherited
-
parsePkcs12Pure(
Uint8List der, {String password = ''}) → Pkcs12Bundle -
Opens a PKCS#12/PFX with the pure Dart decoder: no OpenSSL in the
decryption path and no need for the
legacyprovider.inherited -
parseTimestampResponse(
Uint8List der) → TimestampResponse -
Parses a
TimeStampRespreturned by a TSA.inherited -
parseTimestampToken(
Uint8List tokenDer) → TimestampToken -
Parses a bare token (the CMS/PKCS#7
TimeStampToken), without the response envelope — the shape usually archived next to a signature.inherited -
pbkdf2(
{required Uint8List password, required Uint8List salt, int iterations = 10000, int keyLength = 32}) → Uint8List -
Deriva uma chave a partir de uma senha usando PBKDF2-HMAC-SHA256.
inherited
-
pkcs12LegacyAlgorithms(
Uint8List der) → List< String> -
Legacy algorithms (outside the OpenSSL 3.x default provider) present in
the
derPKCS#12 file, by readable name. Empty when the file only uses algorithms thedefaultprovider supports.inherited -
pkcs12NeedsLegacyProvider(
Uint8List der) → bool -
Whether the
derPKCS#12 file needs thelegacyprovider to be opened.inherited -
pkcs7Pad(
Uint8List data, {int blockSize = 16}) → Uint8List -
Applies PKCS#7 padding to
datafor a givenblockSize.inherited -
pkcs7Unpad(
Uint8List padded, {int blockSize = 16}) → Uint8List -
Removes PKCS#7 padding from
paddedfor a givenblockSize.inherited -
prefilterIssuerCandidates<
T> ({required List< T> candidates, required bool matches(T candidate)}) → List<T> -
Applies binary pre-filter and falls back to full set on failure/ambiguity.
inherited
-
putCachedCrl(
String key, Uint8List value, {Duration ttl = const Duration(minutes: 15)}) → void -
Optional CRL cache with TTL to avoid mass re-fetch.
inherited
-
putCachedOcsp(
String key, Uint8List value, {Duration ttl = const Duration(minutes: 5)}) → void -
Optional OCSP cache with TTL to avoid mass re-fetch.
inherited
-
randomBytes(
int length) → Uint8List -
Random bytes from OpenSSL's RNG.
inherited
-
readOcspResponseStatus(
{required Uint8List responseDer, required X509Certificate certificate, required X509Certificate issuerCertificate, String hashAlgorithm = 'SHA1', bool requireSuccessfulResponse = true}) → OcspCertificateStatusResult -
Reads OCSP response status for
certificate/issuerCertificate.inherited -
rijndael128CbcDecrypt(
{required Uint8List ciphertext, required Uint8List key, required Uint8List iv}) → Uint8List -
Rijndael is AES. Alias for AES-128-CBC.
inherited
-
rijndael128CbcEncrypt(
{required Uint8List data, required Uint8List key, required Uint8List iv}) → Uint8List -
Rijndael is AES. Alias for AES-128-CBC.
inherited
-
rijndael128GcmDecrypt(
{required Uint8List ciphertext, required Uint8List key, required Uint8List iv, required Uint8List tag, Uint8List? aad}) → Uint8List -
Rijndael is AES. Alias for AES-128-GCM.
inherited
-
rijndael128GcmEncrypt(
{required Uint8List data, required Uint8List key, required Uint8List iv, Uint8List? aad}) → Map< String, Uint8List> -
Rijndael is AES. Alias for AES-128-GCM.
inherited
-
rijndael256CbcDecrypt(
{required Uint8List ciphertext, required Uint8List key, required Uint8List iv}) → Uint8List -
Rijndael is AES. Alias for AES-256-CBC.
inherited
-
rijndael256CbcEncrypt(
{required Uint8List data, required Uint8List key, required Uint8List iv}) → Uint8List -
Rijndael is AES. Alias for AES-256-CBC.
inherited
-
rijndael256GcmDecrypt(
{required Uint8List ciphertext, required Uint8List key, required Uint8List iv, required Uint8List tag, Uint8List? aad}) → Uint8List -
Rijndael is AES. Alias for AES-256-GCM.
inherited
-
rijndael256GcmEncrypt(
{required Uint8List data, required Uint8List key, required Uint8List iv, Uint8List? aad}) → Map< String, Uint8List> -
Rijndael is AES. Alias for AES-256-GCM.
inherited
-
setProviderSearchPath(
String path) → void -
Sets the directory where OpenSSL looks for provider modules
(
legacy.dll,legacy.so, ...).inherited -
sha256(
List< int> data) → Uint8List -
Computes SHA-256 digest of
data.inherited -
sha256Hex(
List< int> data) → String -
SHA-256 of
dataas lowercase hexadecimal:sha256through encodeHex.inherited -
sign(
EvpPkey key, Uint8List data, {String algorithm = 'SHA256', bool allowOneShotFallback = true}) → Uint8List -
Signs
datausing the privatekey.inherited -
signDetached(
{required Uint8List content, required X509Certificate certificate, required EvpPkey privateKey, List< Uint8List> extraCertsDer = const [], String? hashAlgorithm}) → Uint8List -
Generates a detached CMS/PKCS#7 signature (DER) for
content.inherited -
signDetachedContentInfo(
{required Uint8List content, required X509Certificate certificate, required EvpPkey privateKey}) → CmsContent -
Generates a detached CMS/PKCS#7 signature and returns CmsContent.
inherited
-
signDetachedDigest(
{required Uint8List digest, required X509Certificate certificate, required EvpPkey privateKey, List< Uint8List> extraCertsDer = const [], String hashAlgorithm = 'SHA256'}) → Uint8List -
Generates a CMS/PKCS#7 signature for a pre-calculated
digest.digestmust be the SHA-256 hash of the content (32 bytes).inherited -
signMlDsa(
EvpPkey key, Uint8List data, {MlDsaSignatureOptions? options}) → Uint8List -
High-level ML-DSA one-shot sign helper.
inherited
-
signOneShot(
EvpPkey key, Uint8List data, {String? algorithm, MlDsaSignatureOptions? mlDsaOptions}) → Uint8List -
Signs
datain one-shot mode (no Update calls).inherited -
splitPemChain(
String pemChain) → List< String> -
Splits a PEM chain into individual PEM certificate blocks.
inherited
-
startDigest(
String algorithmName, {int bufferSize = EvpDigest.defaultBufferSize}) → EvpDigest -
Starts an incremental digest, for input that arrives in pieces.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unloadProvider(
String name) → bool -
Unloads a provider loaded by loadProvider.
inherited
-
unloadProviders(
) → void -
Unloads every provider loaded through this instance.
inherited
-
verify(
EvpPkey key, Uint8List data, Uint8List signature, {String algorithm = 'SHA256', bool allowOneShotFallback = true}) → bool -
Verifies
signaturefordatausingkey.inherited -
verifyCertificateSignature(
X509Certificate certificate, X509Certificate issuer) → bool -
Verifies the signature of
certificateagainst the public key ofissuer.inherited -
verifyChain(
{required X509Certificate certificate, required List< X509Certificate> anchors, List<X509Certificate> intermediates = const [], List<X509Crl> crls = const [], bool checkRevocation = false, bool checkRevocationChain = false, DateTime? verificationTime, bool ignoreValidity = false, bool partialChain = false, int? maxDepth}) → VerificationResult -
Verifies
certificateagainst the trustedanchors, optionally usingintermediatesto build the chain.inherited -
verifyCmsDetached(
{required Uint8List cmsDer, required Uint8List content, X509Store? store, Uint8List? trustedCertDer}) → bool -
Verifies a detached CMS/PKCS#7 signature using the provided content and
a trusted
storeor a specifictrustedCertDer.inherited -
verifyCmsDetachedContentInfo(
{required CmsContent cms, required Uint8List content, X509Store? store, Uint8List? trustedCertDer, bool skipSignerCertVerify = false}) → bool -
Verifies a detached CMS signature using a provided CmsContent.
inherited
-
verifyCmsDetachedFullChain(
{required CmsContent cms, required Uint8List content, required X509Store store}) → bool -
Verifies signature and signer certificate chain using
store.inherited -
verifyCmsDetachedSignatureOnly(
{required CmsContent cms, required Uint8List content}) → bool -
Verifies only the signature (skips signer cert chain validation).
inherited
-
verifyCmsDetachedWithResult(
{required Uint8List cmsDer, required Uint8List content, X509Store? store, Uint8List? trustedCertDer}) → CmsValidationResult -
Verifies a detached CMS/PKCS#7 signature and returns detailed result.
inherited
-
verifyMlDsa(
EvpPkey key, Uint8List data, Uint8List signature, {MlDsaSignatureOptions? options}) → bool -
High-level ML-DSA one-shot verify helper.
inherited
-
verifyOneShot(
EvpPkey key, Uint8List data, Uint8List signature, {String? algorithm, MlDsaSignatureOptions? mlDsaOptions}) → bool -
Verifies
signaturefordatain one-shot mode (no Update calls).inherited -
verifyTimestamp(
{Uint8List? responseDer, Uint8List? tokenDer, required Uint8List hash, required List< X509Certificate> anchors, String hashAlgorithm = 'SHA256', BigInt? nonce, String? policyOid, List<X509Certificate> intermediates = const [], bool checkSignerName = false}) → TimestampVerification -
Verifies a time-stamp token against
hashand a set of trustanchors.inherited -
x509GetSerialBytes(
Pointer< X509> cert) → Uint8List -
Reads certificate serial bytes directly from ASN1_INTEGER payload.
inherited
-
x509GetSerialDecimal(
Pointer< X509> cert) → String -
Gets certificate serial as decimal string using BIGNUM conversion.
inherited
-
x509GetSerialHex(
Pointer< X509> cert, {bool prefixed = true}) → String -
Gets certificate serial as hexadecimal string.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited