PublicKey class final

An RSA public key, which verifies with any VerificationAlgorithm whose modulus floor it meets.

Implemented types

Constructors

PublicKey(Uint8List der)
Parses a PKCS#1 RSAPublicKey, throwing RindError.keyRejected for a malformed one. A modulus below an algorithm's floor parses, and verify refuses it.
PublicKey.fromComponents({required Uint8List n, required Uint8List e})
Loads a key from its big-endian modulus n and exponent e, as a JWK carries them.
PublicKey.fromSpki(Uint8List der)
Parses a SubjectPublicKeyInfo, throwing RindError.keyRejected for a malformed one or one naming another algorithm.

Properties

bytes → Uint8List
The key's PKCS#1 RSAPublicKey encoding, as PublicKey.new takes it.
no setter
hashCode → int
The hash code for this object.
no setterinherited
modulusLength → int
The modulus's length in bytes, which is its signatures' length too.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toSpki() → Uint8List
Encodes the key as a SubjectPublicKeyInfo.
toString() → String
A string representation of this object.
inherited
verify(VerificationAlgorithm algorithm, Uint8List message, Uint8List signature) → void
Checks that signature is the key's signature of message under algorithm, throwing RindError.badSignature if not, or RindError.keyRejected if the modulus is below algorithm's floor or too short for its PSS salt.

Operators

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