Class EDDSAPrivateKey
- java.lang.Object
-
- io.jans.as.model.crypto.PrivateKey
-
- io.jans.as.model.crypto.signature.EDDSAPrivateKey
-
- All Implemented Interfaces:
JSONable
public class EDDSAPrivateKey extends PrivateKey
Edwards Curve Digital Signature Algorithm (EDDSA) Private Key- Version:
- July 23, 2021
- Author:
- Sergey Manoylo
-
-
Constructor Summary
Constructors Constructor Description EDDSAPrivateKey(EDDSAPrivateKey eddsaPrivateKey)
Copy ConstructorEDDSAPrivateKey(SignatureAlgorithm signatureAlgorithm, byte[] dEncoded, byte[] xEncoded)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getPrivateKeyDecoded()
Returns original array (decoded) of the public key (ED25519 - 32 byte, ED448 - 56 bytes);byte[]
getPrivateKeyEncoded()
Returns encoded private keyjava.security.spec.PKCS8EncodedKeySpec
getPrivateKeySpec()
Returns public key value array (PKCS8 encoded, Private-Key Information Syntax Standard) in PKCS8EncodedKeySpec object; PKCS8EncodedKeySpec allows to get encoded array (byte[] getEncoded());byte[]
getPublicKeyDecoded()
Returns original array (decoded) of the public key (ED25519 - 32 byte, ED448 - 56 bytes);byte[]
getPublicKeyEncoded()
Returns encoded public keyjava.security.spec.X509EncodedKeySpec
getPublicKeySpec()
Returns public key value array (X509 encoded) in X509EncodedKeySpec object; X509EncodedKeySpec allows to get encoded array (byte[]);org.json.JSONObject
toJSONObject()
Converts EDDSA private key to JSON Objectjava.lang.String
toString()
Converts EDDSA private key to String Object-
Methods inherited from class io.jans.as.model.crypto.PrivateKey
getKeyId, getSignatureAlgorithm, setKeyId, setSignatureAlgorithm
-
-
-
-
Constructor Detail
-
EDDSAPrivateKey
public EDDSAPrivateKey(SignatureAlgorithm signatureAlgorithm, byte[] dEncoded, byte[] xEncoded)
Constructor- Parameters:
signatureAlgorithm
-dEncoded
-xEncoded
-
-
EDDSAPrivateKey
public EDDSAPrivateKey(EDDSAPrivateKey eddsaPrivateKey)
Copy Constructor- Parameters:
eddsaPrivateKey
-
-
-
Method Detail
-
getPrivateKeySpec
public java.security.spec.PKCS8EncodedKeySpec getPrivateKeySpec()
Returns public key value array (PKCS8 encoded, Private-Key Information Syntax Standard) in PKCS8EncodedKeySpec object; PKCS8EncodedKeySpec allows to get encoded array (byte[] getEncoded());- Returns:
- public key value array (PKCS8 encoded, Private-Key Information Syntax Standard) in PKCS8EncodedKeySpec object; PKCS8EncodedKeySpec allows to get encoded array (byte[] getEncoded());
-
getPublicKeySpec
public java.security.spec.X509EncodedKeySpec getPublicKeySpec()
Returns public key value array (X509 encoded) in X509EncodedKeySpec object; X509EncodedKeySpec allows to get encoded array (byte[]);- Returns:
- public key value array (X509 encoded) in X509EncodedKeySpec object; X509EncodedKeySpec allows to get encoded array (byte[]);
-
getPrivateKeyDecoded
public byte[] getPrivateKeyDecoded() throws java.io.IOException
Returns original array (decoded) of the public key (ED25519 - 32 byte, ED448 - 56 bytes);- Returns:
- original array (decoded) of the public key (ED25519 - 32 byte, ED448 - 56 bytes);
- Throws:
java.io.IOException
-
getPrivateKeyEncoded
public byte[] getPrivateKeyEncoded()
Returns encoded private key- Returns:
-
getPublicKeyDecoded
public byte[] getPublicKeyDecoded()
Returns original array (decoded) of the public key (ED25519 - 32 byte, ED448 - 56 bytes);- Returns:
- original array (decoded) of the public key (ED25519 - 32 byte, ED448 - 56 bytes);
-
getPublicKeyEncoded
public byte[] getPublicKeyEncoded()
Returns encoded public key- Returns:
-
toJSONObject
public org.json.JSONObject toJSONObject() throws org.json.JSONException
Converts EDDSA private key to JSON Object- Throws:
org.json.JSONException
-
toString
public java.lang.String toString()
Converts EDDSA private key to String Object- Overrides:
toString
in classjava.lang.Object
-
-