PublicKey class

A public key of the X-Wing hybrid KEM (X25519 + ML-KEM-768).

Available extensions

Properties

hashCode int
The hash code for this object.
no setterinherited
inner → XhpkePublicKey

Available on PublicKey, provided by the PublicKeyInternal extension

no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fingerprint() Fingerprint
Returns a 256-bit unique identifier for this key. For HPKE, that is the SHA256 hash of the raw public key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
seal({required Uint8List msgToSeal, required Uint8List msgToAuth, required Uint8List domain}) → (Uint8List, Uint8List)
Encrypts a message to this public key.
toBytes() Uint8List
Converts a public key into a 1216-byte array.
toCertDer({required SecretKey signer, required String subjectName, required String issuerName, required BigInt notBefore, required BigInt notAfter, required bool isCa, int? pathLen}) Uint8List
Generates a DER-encoded X.509 certificate for this public key, signed by the given xDSA secret key with the specified validity period.
toCertPem({required SecretKey signer, required String subjectName, required String issuerName, required BigInt notBefore, required BigInt notAfter, required bool isCa, int? pathLen}) String
Generates a PEM-encoded X.509 certificate for this public key, signed by the given xDSA secret key with the specified validity period.
toDer() Uint8List
Serializes a public key into a DER buffer.
toPem() String
Serializes a public key into a PEM string.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

fromBytes(Uint8List bytes) PublicKey
Converts a 1216-byte array into a public key.
fromCertDer(Uint8List der, {required PublicKey signer}) → (PublicKey, BigInt, BigInt)
Parses a public key from a DER-encoded certificate, verifying the xDSA signature.
fromCertPem(String pem, {required PublicKey signer}) → (PublicKey, BigInt, BigInt)
Parses a public key from a PEM-encoded certificate, verifying the xDSA signature.
fromDer(Uint8List der) PublicKey
Parses a DER buffer into a public key.
fromPem(String pem) PublicKey
Parses a PEM string into a public key.