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
nand exponente, 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
RSAPublicKeyencoding, 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
signatureis the key's signature ofmessageunderalgorithm, throwing RindError.badSignature if not, or RindError.keyRejected if the modulus is belowalgorithm's floor or too short for its PSS salt.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited