public class EdDSAPublicKey extends Object implements EdDSAKey, PublicKey
For compatibility with older releases, decoding supports both RFC 8410 and an older draft specification.
KEY_ALGORITHM| Constructor and Description |
|---|
EdDSAPublicKey(EdDSAPublicKeySpec spec)EdDSAPublicKey. |
EdDSAPublicKey(X509EncodedKeySpec spec)Create from X.509. |
| Modifier and Type | Method and Description |
|---|---|
boolean | equals(Object o)Whether this key is equal to the given key. |
GroupElement | getA()The public key point A. |
byte[] | getAbyte()The encoded public key. |
String | getAlgorithm()The reported algorithm name for all EdDSA keys. |
byte[] | getEncoded()Returns the public key in its canonical encoding. |
String | getFormat()The encoding format of the key. |
GroupElement | getNegativeA()The negated public key point. |
EdDSAParameterSpec | getParams()The EdDSA domain parameters for the key. |
int | hashCode()Hash code of the public key bytes, for use in hash tables. |
public EdDSAPublicKey(EdDSAPublicKeySpec spec)
spec - the public key specificationpublic EdDSAPublicKey(X509EncodedKeySpec spec) throws InvalidKeySpecException
spec - the X.509 key specificationInvalidKeySpecException - if the spec is invalidpublic boolean equals(Object o)
public GroupElement getA()
public byte[] getAbyte()
public String getAlgorithm()
getAlgorithm in interface Keypublic byte[] getEncoded()
This implements the following specs:
For keys in older formats, decoding and then re-encoding is sufficient to migrate them to the canonical encoding.
Relevant spec quotes:
In the X.509 certificate, the subjectPublicKeyInfo field has the
SubjectPublicKeyInfo type, which has the following ASN.1 syntax:
SubjectPublicKeyInfo ::= SEQUENCE {
algorithm AlgorithmIdentifier,
subjectPublicKey BIT STRING
}
AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL
}
For all of the OIDs, the parameters MUST be absent.
id-Ed25519 OBJECT IDENTIFIER ::= { 1 3 101 112 }
getEncoded in interface Keypublic String getFormat()
public GroupElement getNegativeA()
public EdDSAParameterSpec getParams()