Class 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 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 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 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 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:
        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 String toString()
        Converts EDDSA private key to String Object
        Overrides:
        toString in class Object