public class EdPublicKey extends AbstractECPublicKey implements EdKey
PublicKeyInfo which makes it suitable for use in X.509 certificates.
References:
[1] Algorithm Identifiers for Ed25519, Ed448, X25519 and X448 for use in the Internet X.409 Public Key Infrastructure. S. Josefsson and J. Schaad. https://tools.ietf.org/html/draft-ietf-curdle-pkix-04
EdKey,
EdPublicKeySpec,
X25519KeyPairGenerator,
X448KeyPairGenerator,
EdDSAPrivateKey,
EdDSA25519KeyPairGenerator,
EdDSA448KeyPairGenerator,
Serialized FormencodedPublicKey_, params_, w_serialVersionUID| Constructor and Description |
|---|
EdPublicKey(iaik.asn1.ASN1Object keyObj)
Creates a new public key from an ASN.1 object.
|
EdPublicKey(byte[] encoded)
Creates a new public key from an ASN.1 encoded DER byte array.
|
EdPublicKey(EdParameterSpec params,
byte[] wBytes)
Creates a new public key object.
|
EdPublicKey(EdParameterSpec params,
ECPoint w)
Creates a new public key object.
|
EdPublicKey(EdParameterSpec params,
ECPoint w,
boolean check)
Creates a new public key object.
|
EdPublicKey(EdPublicKeySpec keySpec)
Creates a new public key object from a spec.
|
EdPublicKey(InputStream is)
Reads the DER or BER encoded public key info from an input stream.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
createEncodedPublicKey()
Creates the ASN.1 public key structure.
|
protected void |
decode(byte[] publicKey) |
boolean |
equals(Object obj) |
String |
getAlgorithm() |
int |
getKeyLength()
Returns the key length of this
ECKey. |
EdParameterSpec |
getParams()
Returns the domain parameters of the associated elliptic curve.
|
byte[] |
getWBytes()
Return encoded public key point.
|
int |
hashCode() |
boolean |
isValid()
Determines whether this public key is valid, i.e.
|
String |
toString() |
encode, getWclone, createPublicKeyInfo, decode, getAlgorithmID, getEncoded, getFingerprint, getFormat, getPublicKey, getPublicKey, getPublicKey, getPublicKey, getPublicKey, getPublicKey, toASN1Object, writeTofinalize, getClass, notify, notifyAll, wait, wait, waitgetEncoded, getFormatpublic EdPublicKey(EdParameterSpec params, ECPoint w)
params - the domain parameters of the elliptic curvew - the point on the curve, satisfying W = s*Gpublic EdPublicKey(EdParameterSpec params, ECPoint w, boolean check)
params - the domain parameters of the elliptic curvew - the point on the curve, satisfying W = s*Gcheck - check if w is a valid pointpublic EdPublicKey(byte[] encoded)
throws InvalidKeyException
encoded - the byte arrayInvalidKeyException - thrown if the given encoded key could not be decodedpublic EdPublicKey(iaik.asn1.ASN1Object keyObj)
throws InvalidKeyException
keyObj - the ASN.1 object holding the public key informationInvalidKeyException - if the given ASN1Object does not hold a valid EdDSA
public keypublic EdPublicKey(InputStream is) throws IOException, InvalidKeyException
is - the input stream providing the dataInvalidKeyException - if the provided key data is invalidIOException - if the I/O error occurspublic EdPublicKey(EdPublicKeySpec keySpec)
keySpec - the key materialpublic EdPublicKey(EdParameterSpec params, byte[] wBytes)
params - the domain parameters of the elliptic curvewBytes - the (encoded) point on the curve, satisfying W = s*Gpublic EdParameterSpec getParams()
ECKeyprotected void decode(byte[] publicKey)
throws InvalidKeyException
decode in class iaik.x509.PublicKeyInfoInvalidKeyExceptionpublic String getAlgorithm()
getAlgorithm in interface KeygetAlgorithm in class iaik.x509.PublicKeyInfopublic int getKeyLength()
ECKeyECKey.protected void createEncodedPublicKey()
AbstractECPublicKeycreateEncodedPublicKey in class AbstractECPublicKeypublic int hashCode()
hashCode in class AbstractECPublicKeypublic boolean equals(Object obj)
equals in class AbstractECPublicKeypublic boolean isValid()
isValid in class AbstractECPublicKeypublic String toString()
toString in class iaik.x509.PublicKeyInfopublic byte[] getWBytes()
Copyright © 2011–2022 Stiftung SIC. All rights reserved.