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, getW
clone, createPublicKeyInfo, decode, getAlgorithmID, getEncoded, getFingerprint, getFormat, getPublicKey, getPublicKey, getPublicKey, getPublicKey, getPublicKey, getPublicKey, toASN1Object, writeTo
finalize, getClass, notify, notifyAll, wait, wait, wait
getEncoded, getFormat
public EdPublicKey(EdParameterSpec params, ECPoint w)
params
- the domain parameters of the elliptic curvew
- the point on the curve, satisfying W = s*G
public EdPublicKey(EdParameterSpec params, ECPoint w, boolean check)
params
- the domain parameters of the elliptic curvew
- the point on the curve, satisfying W = s*G
check
- 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*G
public EdParameterSpec getParams()
ECKey
protected void decode(byte[] publicKey) throws InvalidKeyException
decode
in class iaik.x509.PublicKeyInfo
InvalidKeyException
public String getAlgorithm()
getAlgorithm
in interface Key
getAlgorithm
in class iaik.x509.PublicKeyInfo
public int getKeyLength()
ECKey
ECKey
.protected void createEncodedPublicKey()
AbstractECPublicKey
createEncodedPublicKey
in class AbstractECPublicKey
public int hashCode()
hashCode
in class AbstractECPublicKey
public boolean equals(Object obj)
equals
in class AbstractECPublicKey
public boolean isValid()
isValid
in class AbstractECPublicKey
public String toString()
toString
in class iaik.x509.PublicKeyInfo
public byte[] getWBytes()
Copyright © 2011–2022 Stiftung SIC. All rights reserved.