SubjectPublicKeyInfo class Null safety
The "Subject Public Key Info" is defined by ASN.1 as a part of X.509. It consists of an algorithm (identified by an OID with optional parameters) and a bit string.
This is one of the formats that can be used by OpenSSH to store public keys. It is text encoded with the label of "PUBLIC KEY" (i.e. the pre encapsulation boundary is "-----BEGIN PUBLIC KEY-----"). OpenSSH incorrectly and confusingly refers to this format as "PKCS#8". Real PKCS #8 is a format for private keys, not public keys, and does not specify this format. To avoid further confusion, this format will be referred to as the Subject Public Key Info format, or SPKI for short.
This format is used in conjunction with the RFC 7468 textual encoding (sometimes imprecisely referred to as "PEM").
The SubjectPublicKeyInfo is defined in X.509: section 4.1 of RFC 2459.
SubjectPublicKeyInfo ::= SEQUENCE {
algorithm AlgorithmIdentifier,
subjectPublicKey BIT STRING }
The AlgorithmIdentifier is defined in section 4.1.1.2 of RFC 5280
AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL }
The bit string contents of the subjectPublicKey depend on the algorithm used, and are defined in RFC 3279.
Note: this class decodes from, and encodes to, binary data. That binary data is usually decoded from text, or encoded to text, using RFC 7468 Textual Encoding, which is implemented by TextualEncoding.
- Implemented types
Constructors
-
SubjectPublicKeyInfo(String algorithmOid, List<
ASN1Object> algorithmParameters, Uint8List data) - Constructor from values
- SubjectPublicKeyInfo.decode(Uint8List bytes, {required PubTextSource? source})
- Decode from a sequence of bytes.
Properties
- algorithmOid ↔ String
-
Object Identifier (OID) that identifies the algorithm.
read / write
-
algorithmParameters
↔ List<
ASN1Object> -
Additional parameters for the algorithm.
read / write
- data ↔ Uint8List
-
Binary data containing the public key
read / write
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- 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 non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
A string representation of this object. [...]
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited