Class EDDSAKeyFactory


  • public class EDDSAKeyFactory
    extends KeyFactory<EDDSAPrivateKey,​EDDSAPublicKey>
    Factory to create asymmetric Public and Private Keys for the Edwards Curve Digital Signature Algorithm (EDDSA)
    Version:
    July 23, 2021
    Author:
    Sergey Manoylo
    • Field Detail

      • Ed448Prefix

        protected static final byte[] Ed448Prefix
      • Ed25519Prefix

        protected static final byte[] Ed25519Prefix
    • Constructor Detail

      • EDDSAKeyFactory

        public EDDSAKeyFactory​(SignatureAlgorithm signatureAlgorithm,
                               java.lang.String dnName)
                        throws java.security.NoSuchAlgorithmException,
                               java.security.NoSuchProviderException,
                               java.security.InvalidAlgorithmParameterException,
                               org.bouncycastle.operator.OperatorCreationException,
                               java.security.cert.CertificateException
        Constructor
        Parameters:
        signatureAlgorithm -
        dnName -
        Throws:
        java.security.NoSuchProviderException
        java.security.NoSuchAlgorithmException
        java.security.InvalidAlgorithmParameterException
        org.bouncycastle.operator.OperatorCreationException
        java.security.cert.CertificateException
    • Method Detail

      • generateV3Certificate

        public Certificate generateV3Certificate​(java.util.Date startDate,
                                                 java.util.Date expirationDate,
                                                 java.lang.String dnName)
                                          throws java.security.SignatureException
        Generates certificate X509 v3
        Parameters:
        startDate -
        expirationDate -
        dnName -
        Returns:
        Throws:
        java.security.cert.CertificateEncodingException
        java.security.InvalidKeyException
        java.lang.IllegalStateException
        java.security.NoSuchProviderException
        java.security.NoSuchAlgorithmException
        java.security.SignatureException
      • createEDDSAPublicKeyFromDecodedKey

        public static EDDSAPublicKey createEDDSAPublicKeyFromDecodedKey​(SignatureAlgorithm signatureAlgorithm,
                                                                        byte[] decodedPublicKey)
                                                                 throws java.security.SignatureException
        Creates EDDSA public key from decoded array
        Parameters:
        signatureAlgorithm -
        decodedPublicKey -
        Returns:
        Throws:
        java.security.SignatureException
      • createEDDSAPrivateKeyFromDecodedKey

        public static EDDSAPrivateKey createEDDSAPrivateKeyFromDecodedKey​(SignatureAlgorithm signatureAlgorithm,
                                                                          byte[] decodedPrivateKey,
                                                                          byte[] decodedPublicKey)
                                                                   throws java.security.SignatureException,
                                                                          java.io.IOException
        Creates EDDSA private key from decoded array
        Parameters:
        signatureAlgorithm -
        decodedPrivateKey -
        decodedPublicKey -
        Returns:
        Throws:
        java.security.SignatureException
        java.io.IOException