java.io.Serializable, java.security.Key, java.security.PrivateKey, javax.security.auth.Destroyable, EdDSAKeypublic class EdDSAPrivateKey extends java.lang.Object implements EdDSAKey, java.security.PrivateKey
Warning: Private key encoding is not fully specified in the current IETF draft. This implementation uses PKCS#8 encoding, and is subject to change. See getEncoded().
Ref: https://tools.ietf.org/html/draft-josefsson-pkix-eddsa-04
| コンストラクタ | 説明 |
|---|---|
EdDSAPrivateKey(java.security.spec.PKCS8EncodedKeySpec spec) |
|
EdDSAPrivateKey(EdDSAPrivateKeySpec spec) |
| 修飾子とタイプ | メソッド | 説明 |
|---|---|---|
boolean |
equals(java.lang.Object o) |
|
byte[] |
geta() |
|
GroupElement |
getA() |
|
byte[] |
getAbyte() |
|
java.lang.String |
getAlgorithm() |
|
byte[] |
getEncoded() |
This follows the docs from
java.security.spec.PKCS8EncodedKeySpec
quote:
|
java.lang.String |
getFormat() |
|
byte[] |
getH() |
|
EdDSAParameterSpec |
getParams() |
return a parameter specification representing the EdDSA domain
parameters for the key.
|
byte[] |
getSeed() |
|
int |
hashCode() |
public EdDSAPrivateKey(EdDSAPrivateKeySpec spec)
public EdDSAPrivateKey(java.security.spec.PKCS8EncodedKeySpec spec)
throws java.security.spec.InvalidKeySpecException
java.security.spec.InvalidKeySpecExceptionpublic java.lang.String getAlgorithm()
getAlgorithm インタフェース内 java.security.Keypublic java.lang.String getFormat()
getFormat インタフェース内 java.security.Keypublic byte[] getEncoded()
The PrivateKeyInfo syntax is defined in the PKCS#8 standard as follows:
PrivateKeyInfo ::= SEQUENCE {
version Version,
privateKeyAlgorithm PrivateKeyAlgorithmIdentifier,
privateKey PrivateKey,
attributes [0] IMPLICIT Attributes OPTIONAL }
Version ::= INTEGER
PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier
PrivateKey ::= OCTET STRING
Attributes ::= SET OF Attribute
AlgorithmIdentifier ::= SEQUENCE
{
algorithm OBJECT IDENTIFIER,
parameters ANY OPTIONAL
}
Ref: https://tools.ietf.org/html/draft-josefsson-pkix-eddsa-04
Note that the private key encoding is not fully specified in the Josefsson draft version 04,
and the example could be wrong, as it's lacking Version and AlgorithmIdentifier.
This will hopefully be clarified in the next draft.
But sun.security.pkcs.PKCS8Key expects them so we must include them for keytool to work.
This encodes the seed. It will return null if constructed from
a spec which was directly constructed from H, in which case seed is null.getEncoded インタフェース内 java.security.Keypublic EdDSAParameterSpec getParams()
EdDSAKeypublic byte[] getSeed()
public byte[] getH()
public byte[] geta()
public GroupElement getA()
public byte[] getAbyte()
public int hashCode()
hashCode クラス内 java.lang.Objectpublic boolean equals(java.lang.Object o)
equals クラス内 java.lang.Object