EncryptingKey class final

An RSA public key that encrypts with RSA-OAEP.

Implemented types

Constructors

EncryptingKey(OaepAlgorithm algorithm, Uint8List der)
Parses a PKCS#1 RSAPublicKey for algorithm, refusing a modulus below 2048 bits.
EncryptingKey.fromComponents(OaepAlgorithm algorithm, {required Uint8List n, required Uint8List e})
Loads a key for algorithm from its big-endian modulus n and exponent e, as a JWK carries them.
EncryptingKey.fromSpki(OaepAlgorithm algorithm, Uint8List der)
Parses a SubjectPublicKeyInfo for algorithm, refusing one naming another algorithm or a modulus below 2048 bits.

Properties

algorithm → OaepAlgorithm
The algorithm the key encrypts with.
final
bytes → Uint8List
The key's PKCS#1 RSAPublicKey encoding, as EncryptingKey.new takes it.
no setter
hashCode → int
The hash code for this object.
no setterinherited
maxMessageLength → int
The longest message the key encrypts, in bytes.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

encrypt(Uint8List message, {Uint8List? label}) → Uint8List
Encrypts message with label, returning a ciphertext as long as the modulus, and throwing RindError.wrongLength for a message longer than maxMessageLength.
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

Operators

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