Pkcs1RsaPublicKey class

PKCS #1 version 2.0 representation of an RSA public key.

This class can be used to:

  • Decode a sequence of bytes into the parameters for an RSA public key using the decode constructor; or
  • Encode the parameters for an RSA public key into a sequence of bytes using the encode method.

The RSA public key parameters are the modulus and the public exponent.

Format

This binary format is defined in RFC 2437 PKCS #1: RSA Cryptography Specifications, Version 2.0 by this ASN.1 type:

RSAPublicKey ::= SEQUENCE {
  modulus           INTEGER,  -- n
  publicExponent    INTEGER   -- e
}

Where:

  • modulus is the RSA modulus n.
  • publicExponent is the RSA public exponent e.

The ASN.1 type is identical in PKCS #1 version 1.5, PKCS #1 version 2.1 and PKCS #1 version 2.2.

PKCS #1 version 2.0 is referenced, because that is the version implemented by Pkcs1RsaPrivateKey.

Implemented types

Constructors

Pkcs1RsaPublicKey(BigInt modulus, BigInt exponent, [PubTextSource? source])
Constructor.
Pkcs1RsaPublicKey.decode(Uint8List data, PubTextSource? source)
Decode from a sequence of bytes.

Properties

exponent BigInt
RSA exponent
latefinal
hashCode int
The hash code for this object.
no setterinherited
modulus BigInt
RSA modulus
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source PubTextSource?
Source this was decoded from.
final

Methods

encode() Uint8List
Encode as a sequence of bytes.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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