Package io.jans.as.model.crypto
Class AbstractCryptoProvider
java.lang.Object
io.jans.as.model.crypto.AbstractCryptoProvider
- Direct Known Subclasses:
AuthCryptoProvider
- Version:
- October 26, 2021
- Author:
- Javier Rojas Blum, Sergey Manoylo
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckKeyExpiration(String alias, Long expirationTime) abstract booleancontainsKey(String keyId) abstract booleanstatic org.json.JSONObjectgenerateJwks(AbstractCryptoProvider cryptoProvider, AppConfiguration configuration) abstract org.json.JSONObjectgenerateKey(Algorithm algorithm, Long expirationTime) abstract org.json.JSONObjectgenerateKey(Algorithm algorithm, Long expirationTime, int keyLength) abstract org.json.JSONObjectgenerateKey(Algorithm algorithm, Long expirationTime, int keyLength, KeyOpsType keyOpsType) getKeyId(JSONWebKeySet jsonWebKeySet, Algorithm algorithm, Use use, KeyOpsType keyOps) intgetKeys()abstract PrivateKeygetPrivateKey(String keyId) abstract PublicKeygetPublicKey(String alias) getPublicKey(String alias, org.json.JSONObject jwks, Algorithm requestedAlgorithm) voidsetKeyRegenerationIntervalInDays(int keyRegenerationIntervalInDays) abstract Stringsign(String signingInput, String keyId, String sharedSecret, SignatureAlgorithm signatureAlgorithm) abstract booleanverifySignature(String signingInput, String encodedSignature, String keyId, org.json.JSONObject jwks, String sharedSecret, SignatureAlgorithm signatureAlgorithm)
-
Field Details
-
LOG
protected static final org.apache.log4j.Logger LOG
-
-
Constructor Details
-
AbstractCryptoProvider
public AbstractCryptoProvider()
-
-
Method Details
-
generateKey
public abstract org.json.JSONObject generateKey(Algorithm algorithm, Long expirationTime) throws CryptoProviderException - Throws:
CryptoProviderException
-
generateKey
public abstract org.json.JSONObject generateKey(Algorithm algorithm, Long expirationTime, int keyLength) throws CryptoProviderException - Throws:
CryptoProviderException
-
generateKey
public abstract org.json.JSONObject generateKey(Algorithm algorithm, Long expirationTime, int keyLength, KeyOpsType keyOpsType) throws CryptoProviderException - Throws:
CryptoProviderException
-
sign
public abstract String sign(String signingInput, String keyId, String sharedSecret, SignatureAlgorithm signatureAlgorithm) throws CryptoProviderException - Throws:
CryptoProviderException
-
verifySignature
public abstract boolean verifySignature(String signingInput, String encodedSignature, String keyId, org.json.JSONObject jwks, String sharedSecret, SignatureAlgorithm signatureAlgorithm) throws CryptoProviderException - Throws:
CryptoProviderException
-
deleteKey
- Throws:
CryptoProviderException
-
containsKey
-
getKeys
-
getPrivateKey
- Throws:
CryptoProviderException
-
getPublicKey
- Throws:
CryptoProviderException
-
getKeyId
public String getKeyId(JSONWebKeySet jsonWebKeySet, Algorithm algorithm, Use use, KeyOpsType keyOps) throws CryptoProviderException - Throws:
CryptoProviderException
-
generateJwks
public static org.json.JSONObject generateJwks(AbstractCryptoProvider cryptoProvider, AppConfiguration configuration) -
getPublicKey
public PublicKey getPublicKey(String alias, org.json.JSONObject jwks, Algorithm requestedAlgorithm) throws CryptoProviderException - Throws:
CryptoProviderException
-
checkKeyExpiration
-
getKeyRegenerationIntervalInDays
public int getKeyRegenerationIntervalInDays() -
setKeyRegenerationIntervalInDays
public void setKeyRegenerationIntervalInDays(int keyRegenerationIntervalInDays)
-