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
    • 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 key
      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());
      byte[] getPublicKeyDecoded()
      Returns original array (decoded) of the public key (ED25519 - 32 byte, ED448 - 56 bytes);
      byte[] getPublicKeyEncoded()
      Returns encoded public key
      java.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 Object
      java.lang.String toString()
      Converts EDDSA private key to String Object
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 class java.lang.Object