public final class EdDSAPrivateKey extends EdPrivateKey
ECPrivateKey interface. It is derived
from PrivateKeyInfo, which makes it suitable for use with PKCS#8.
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,
EdPublicKey,
EdPublicKeySpec,
EdDSAKeyPairGenerator,
EdDSAPrivateKeySpec,
Serialized Formseed_encodedPrivateKey_, params_, s_, w_serialVersionUID| Constructor and Description |
|---|
EdDSAPrivateKey(byte[] encoded)
Constructs a new
EdDSAPrivateKey from an encoded ASN.1 structure. |
EdDSAPrivateKey(EdDSAPrivateKeySpec keySpec)
Constructs a new
EdDSAPrivateKey from an IAIK
EdDSAPrivateKeySpec object. |
EdDSAPrivateKey(EdParameterSpec params,
byte[] seed)
Constructs a new
ECPrivateKey from a set of curve parameters and a
private key seed. |
EdDSAPrivateKey(EdParameterSpec params,
byte[] seed,
byte[] hash,
BigInteger s,
ECPoint w)
Constructs a new
ECPrivateKey from a set of curve parameters and a
private key seed and all derived values. |
| Modifier and Type | Method and Description |
|---|---|
protected ECPoint |
computeOrGetW()
Check if public point is set and return it.
|
protected void |
decode(byte[] privateKey)
Decodes the DER encoded private key.
|
protected void |
finalize() |
String |
getAlgorithm() |
computeS, createEncodedPrivateKey, getKeyLength, getParams, getPublicKey, getSeed, toStringencode, equals, getS, hashCodeclone, createPrivateKeyInfo, decode, getAlgorithmID, getAttributes, getEncoded, getFormat, getPrivateKey, getPrivateKey, getPrivateKey, getPrivateKey, getPrivateKey, getPrivateKey, getPubKey, setAttributes, setPubKey, toASN1Object, writeTogetEncoded, getFormatdestroy, isDestroyedpublic EdDSAPrivateKey(EdDSAPrivateKeySpec keySpec)
EdDSAPrivateKey from an IAIK
EdDSAPrivateKeySpec object.keySpec - the private key specpublic EdDSAPrivateKey(byte[] encoded)
throws InvalidKeyException
EdDSAPrivateKey from an encoded ASN.1 structure.encoded - the byte[] holding the ASN.1 structureInvalidKeyException - thrown if the given encoded key could not be decodedpublic EdDSAPrivateKey(EdParameterSpec params, byte[] seed)
ECPrivateKey from a set of curve parameters and a
private key seed.params - the curve parametersseed - the private keypublic EdDSAPrivateKey(EdParameterSpec params, byte[] seed, byte[] hash, BigInteger s, ECPoint w)
ECPrivateKey from a set of curve parameters and a
private key seed and all derived values.params - the curve parametersseed - the private keyhash - hash expanded from the seeds - secret scalar extracted from hashw - public keyprotected void finalize()
throws Throwable
finalize in class EdPrivateKeyThrowableprotected void decode(byte[] privateKey)
throws InvalidKeyException
decode in class EdPrivateKeyprivateKey - the DER byte array.InvalidKeyException - if the provided key data is invalid.AbstractECPrivateKey.encode()public String getAlgorithm()
getAlgorithm in interface KeygetAlgorithm in class EdPrivateKeyprotected ECPoint computeOrGetW()
EdPrivateKeycomputeOrGetW in class EdPrivateKeyCopyright © 2011–2022 Stiftung SIC. All rights reserved.