PubKeyEncoding enum
Supported public key encodings.
This enumeration is used to indicate the format that a public key was
decoded from, or to specify the desired format to PublicKeyExt.encode
which is an extension to pointy_castle.PublicKey
.
openSsh
OpenSSH public key format.
This is a proprietary encoding used by the OpenSSH implementation of SSH.
This encoding is a single-line of text, consisting of: a key-type, base-64 encoded data and an optional comment (all separated by a space). For example,
ssh-rsa AAAAB3NzaC1yc2EAAA...nqreXpeh039cotUTWJHyVOB user@example.com
sshPublicKey
SSH public key file format as defined by RFC 4716.
This encoding is sometimes referred to as the "SSH2 public key" format or the "new OpenSSH public key format".
This encoding starts with ---- BEGIN SSH2 PUBLIC KEY ----
(note: four
hyphens, instead of five used in the other formats).
For example,
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "user@example.com"
AAAAB3NzaC1yc2EAAAADAQABAAABAQDYwd6O4Z+STMxTlFCPcN8VAq9ZNKvaQRYbsEDKK0
ydvTxdwt72xRo8supYX1vgDgRpYBhgDy8OPEMLDuk61sXRdbTITFW1B98rUsvvLEYHM4wJ
...
---- END SSH2 PUBLIC KEY ----
pkcs1
Textual encoding of PKCS #1.
This encoding is often referred to as "PEM". But that term is ambiguous, since PEM encoding is used to encode other types of binary data besides public keys. Implementations of PEM encoding also vary.
This implementation uses the textual encoding of RFC 7468, which specifies a unified and interoperable version of PEM and PEM-like text_encodings.
Strictly speaking, this encoding is not PKCS #1, but the RFC 7468 textual encoding of binary data conforming to PKCS #1.
This encoding starts with -----BEGIN RSA PUBLIC KEY-----
. For example,
-----BEGIN RSA PUBLIC KEY-----
MIIBCgKCAQEA2MHejuGfkkzMU5RQj3DfFQKvWTSr2kEWG7BAyitMnb08XcLe9sUa
PLLqWF9b4A4EaWAYYA8vDjxDCw7pOtbF0XW0yExVtQffK1LL7yxGBzOMCUJ5Fmb3
...
-----END RSA PUBLIC KEY-----
Note: this format only supports RSA keys.
x509spki
Textual encoding of the Subject Public Key Info production from X.509.
This is a proprietary encoding used by the OpenSSH implementation of SSH. OpenSSH incorrectly and confusingly refers to this encoding as "PKCS #8". But this encoding is not related to real PKCS #8, which is an encoding of private keys and not public keys.
This encoding is not defined by X.509. That specification only defines an ASN.1 production which is unofficially borrowed by this encoding. Strictly speaking, this encoding is the RFC 7468 textual encoding of binary data conforming to the Subject Public Key Info production.
This encoding starts with -----BEGIN PUBLIC KEY-----
. For example,
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2MHejuGfkkzMU5RQj3Df
FQKvWTSr2kEWG7BAyitMnb08XcLe9sUaPLLqWF9b4A4EaWAYYA8vDjxDCw7pOtbF
...
-----END PUBLIC KEY-----
Constructors
- PubKeyEncoding()
-
const
Values
- openSsh → const PubKeyEncoding
-
OpenSSH Public Key
- sshPublicKey → const PubKeyEncoding
-
SSH Public Key
- pkcs1 → const PubKeyEncoding
-
Textual encoding of PKCS #1
- x509spki → const PubKeyEncoding
-
Textual encoding of subjectPublicKeyInfo from X.509
Properties
Methods
-
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
Constants
-
values
→ const List<
PubKeyEncoding> - A constant List of the values in this enum, in order of their declaration.