Class EDDSAKeyFactory
java.lang.Object
io.jans.as.model.crypto.KeyFactory<EDDSAPrivateKey,EDDSAPublicKey>
io.jans.as.model.crypto.signature.EDDSAKeyFactory
Factory to create asymmetric Public and Private Keys for the Edwards Curve
Digital Signature Algorithm (EDDSA)
- Version:
- July 23, 2021
- Author:
- Sergey Manoylo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final byte[]protected static final byte[] -
Constructor Summary
ConstructorsConstructorDescriptionEDDSAKeyFactory(SignatureAlgorithm signatureAlgorithm, String dnName) Constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic EDDSAPrivateKeycreateEDDSAPrivateKeyFromDecodedKey(SignatureAlgorithm signatureAlgorithm, byte[] decodedPrivateKey, byte[] decodedPublicKey) Creates EDDSA private key from decoded arraystatic EDDSAPublicKeycreateEDDSAPublicKeyFromDecodedKey(SignatureAlgorithm signatureAlgorithm, byte[] decodedPublicKey) Creates EDDSA public key from decoded arraygenerateV3Certificate(Date startDate, Date expirationDate, String dnName) Generates certificate X509 v3Returns X509 CertificateReturns EDDSA Private KeyReturns EDDSA Public KeyMethods inherited from class io.jans.as.model.crypto.KeyFactory
getKey
-
Field Details
-
Ed448Prefix
protected static final byte[] Ed448Prefix -
Ed25519Prefix
protected static final byte[] Ed25519Prefix
-
-
Constructor Details
-
EDDSAKeyFactory
public EDDSAKeyFactory(SignatureAlgorithm signatureAlgorithm, String dnName) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException, org.bouncycastle.operator.OperatorCreationException, CertificateException Constructor- Parameters:
signatureAlgorithm-dnName-- Throws:
NoSuchProviderExceptionNoSuchAlgorithmExceptionInvalidAlgorithmParameterExceptionorg.bouncycastle.operator.OperatorCreationExceptionCertificateException
-
-
Method Details
-
generateV3Certificate
public Certificate generateV3Certificate(Date startDate, Date expirationDate, String dnName) throws SignatureException Generates certificate X509 v3- Overrides:
generateV3Certificatein classKeyFactory<EDDSAPrivateKey,EDDSAPublicKey> - Parameters:
startDate-expirationDate-dnName-- Returns:
- Throws:
IllegalStateExceptionSignatureException
-
getPrivateKey
Returns EDDSA Private Key- Specified by:
getPrivateKeyin classKeyFactory<EDDSAPrivateKey,EDDSAPublicKey>
-
getPublicKey
Returns EDDSA Public Key- Specified by:
getPublicKeyin classKeyFactory<EDDSAPrivateKey,EDDSAPublicKey>
-
getCertificate
Returns X509 Certificate- Specified by:
getCertificatein classKeyFactory<EDDSAPrivateKey,EDDSAPublicKey>
-
createEDDSAPublicKeyFromDecodedKey
public static EDDSAPublicKey createEDDSAPublicKeyFromDecodedKey(SignatureAlgorithm signatureAlgorithm, byte[] decodedPublicKey) throws SignatureException Creates EDDSA public key from decoded array- Parameters:
signatureAlgorithm-decodedPublicKey-- Returns:
- Throws:
SignatureException
-
createEDDSAPrivateKeyFromDecodedKey
public static EDDSAPrivateKey createEDDSAPrivateKeyFromDecodedKey(SignatureAlgorithm signatureAlgorithm, byte[] decodedPrivateKey, byte[] decodedPublicKey) throws SignatureException, IOException Creates EDDSA private key from decoded array- Parameters:
signatureAlgorithm-decodedPrivateKey-decodedPublicKey-- Returns:
- Throws:
SignatureExceptionIOException
-