Package io.jans.as.model.crypto
Class AuthCryptoProvider
- java.lang.Object
- 
- io.jans.as.model.crypto.AbstractCryptoProvider
- 
- io.jans.as.model.crypto.AuthCryptoProvider
 
 
- 
 public class AuthCryptoProvider extends AbstractCryptoProvider - Version:
- November 22, 2021
- Author:
- Javier Rojas Blum, Yuriy Movchan, Sergey Manoylo
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected static org.apache.log4j.LoggerLOG
 - 
Constructor SummaryConstructors Constructor Description AuthCryptoProvider()AuthCryptoProvider(java.lang.String keyStoreFile, java.lang.String keyStoreSecret, java.lang.String dnName)AuthCryptoProvider(java.lang.String keyStoreFile, java.lang.String keyStoreSecret, java.lang.String dnName, boolean rejectNoneAlg)AuthCryptoProvider(java.lang.String keyStoreFile, java.lang.String keyStoreSecret, java.lang.String dnName, boolean rejectNoneAlg, KeySelectionStrategy keySelectionStrategy)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(java.lang.String keyId)booleandeleteKey(java.lang.String alias)org.json.JSONObjectgenerateKey(Algorithm algorithm, java.lang.Long expirationTime)org.json.JSONObjectgenerateKey(Algorithm algorithm, java.lang.Long expirationTime, int keyLength)java.security.cert.X509CertificategenerateV3Certificate(java.security.KeyPair keyPair, java.lang.String issuer, java.lang.String signatureAlgorithm, java.lang.Long expirationTime)java.lang.StringgetAliasByAlgorithmForDeletion(Algorithm algorithm, java.lang.String newAlias)java.lang.StringgetDnName()java.lang.StringgetKeyId(JSONWebKeySet jsonWebKeySet, Algorithm algorithm, Use use)java.util.List<java.lang.String>getKeys()java.security.KeyStoregetKeyStore()java.lang.StringgetKeyStoreFile()java.lang.StringgetKeyStoreSecret()java.security.PrivateKeygetPrivateKey(java.lang.String alias)java.security.PublicKeygetPublicKey(java.lang.String alias)SignatureAlgorithmgetSignatureAlgorithm(java.lang.String alias)voidload()java.lang.Stringsign(java.lang.String signingInput, java.lang.String alias, java.lang.String sharedSecret, SignatureAlgorithm signatureAlgorithm)booleanverifySignature(java.lang.String signingInput, java.lang.String encodedSignature, java.lang.String alias, org.json.JSONObject jwks, java.lang.String sharedSecret, SignatureAlgorithm signatureAlgorithm)- 
Methods inherited from class io.jans.as.model.crypto.AbstractCryptoProvidercheckKeyExpiration, generateJwks, getJwksRequestParam, getKeyRegenerationIntervalInDays, getPublicKey, setKeyRegenerationIntervalInDays
 
- 
 
- 
- 
- 
Constructor Detail- 
AuthCryptoProviderpublic AuthCryptoProvider() throws java.security.KeyStoreException- Throws:
- java.security.KeyStoreException
 
 - 
AuthCryptoProviderpublic AuthCryptoProvider(java.lang.String keyStoreFile, java.lang.String keyStoreSecret, java.lang.String dnName) throws java.security.KeyStoreException- Throws:
- java.security.KeyStoreException
 
 - 
AuthCryptoProviderpublic AuthCryptoProvider(java.lang.String keyStoreFile, java.lang.String keyStoreSecret, java.lang.String dnName, boolean rejectNoneAlg) throws java.security.KeyStoreException- Throws:
- java.security.KeyStoreException
 
 - 
AuthCryptoProviderpublic AuthCryptoProvider(java.lang.String keyStoreFile, java.lang.String keyStoreSecret, java.lang.String dnName, boolean rejectNoneAlg, KeySelectionStrategy keySelectionStrategy) throws java.security.KeyStoreException- Throws:
- java.security.KeyStoreException
 
 
- 
 - 
Method Detail- 
loadpublic void load() throws java.io.IOException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException- Throws:
- java.io.IOException
- java.security.NoSuchAlgorithmException
- java.security.cert.CertificateException
 
 - 
getKeyStoreFilepublic java.lang.String getKeyStoreFile() 
 - 
getKeyStoreSecretpublic java.lang.String getKeyStoreSecret() 
 - 
getDnNamepublic java.lang.String getDnName() 
 - 
generateKeypublic org.json.JSONObject generateKey(Algorithm algorithm, java.lang.Long expirationTime) throws CryptoProviderException - Specified by:
- generateKeyin class- AbstractCryptoProvider
- Throws:
- CryptoProviderException
 
 - 
generateKeypublic org.json.JSONObject generateKey(Algorithm algorithm, java.lang.Long expirationTime, int keyLength) throws CryptoProviderException - Specified by:
- generateKeyin class- AbstractCryptoProvider
- Throws:
- CryptoProviderException
 
 - 
getAliasByAlgorithmForDeletionpublic java.lang.String getAliasByAlgorithmForDeletion(Algorithm algorithm, java.lang.String newAlias) throws java.security.KeyStoreException - Throws:
- java.security.KeyStoreException
 
 - 
containsKeypublic boolean containsKey(java.lang.String keyId) - Specified by:
- containsKeyin class- AbstractCryptoProvider
 
 - 
signpublic java.lang.String sign(java.lang.String signingInput, java.lang.String alias, java.lang.String sharedSecret, SignatureAlgorithm signatureAlgorithm) throws CryptoProviderException- Specified by:
- signin class- AbstractCryptoProvider
- Throws:
- CryptoProviderException
 
 - 
verifySignaturepublic boolean verifySignature(java.lang.String signingInput, java.lang.String encodedSignature, java.lang.String alias, org.json.JSONObject jwks, java.lang.String sharedSecret, SignatureAlgorithm signatureAlgorithm) throws CryptoProviderException- Specified by:
- verifySignaturein class- AbstractCryptoProvider
- Throws:
- CryptoProviderException
 
 - 
deleteKeypublic boolean deleteKey(java.lang.String alias) throws CryptoProviderException- Specified by:
- deleteKeyin class- AbstractCryptoProvider
- Throws:
- CryptoProviderException
 
 - 
getPublicKeypublic java.security.PublicKey getPublicKey(java.lang.String alias) throws CryptoProviderException- Specified by:
- getPublicKeyin class- AbstractCryptoProvider
- Throws:
- CryptoProviderException
 
 - 
getKeyIdpublic java.lang.String getKeyId(JSONWebKeySet jsonWebKeySet, Algorithm algorithm, Use use) throws CryptoProviderException - Overrides:
- getKeyIdin class- AbstractCryptoProvider
- Throws:
- CryptoProviderException
 
 - 
getPrivateKeypublic java.security.PrivateKey getPrivateKey(java.lang.String alias) throws CryptoProviderException- Specified by:
- getPrivateKeyin class- AbstractCryptoProvider
- Throws:
- CryptoProviderException
 
 - 
generateV3Certificatepublic java.security.cert.X509Certificate generateV3Certificate(java.security.KeyPair keyPair, java.lang.String issuer, java.lang.String signatureAlgorithm, java.lang.Long expirationTime) throws org.bouncycastle.cert.CertIOException, org.bouncycastle.operator.OperatorCreationException, java.security.cert.CertificateException- Throws:
- org.bouncycastle.cert.CertIOException
- org.bouncycastle.operator.OperatorCreationException
- java.security.cert.CertificateException
 
 - 
getKeyspublic java.util.List<java.lang.String> getKeys() - Overrides:
- getKeysin class- AbstractCryptoProvider
 
 - 
getSignatureAlgorithmpublic SignatureAlgorithm getSignatureAlgorithm(java.lang.String alias) throws java.security.KeyStoreException - Throws:
- java.security.KeyStoreException
 
 - 
getKeyStorepublic java.security.KeyStore getKeyStore() 
 
- 
 
-