Package io.jans.as.model.crypto
Class AbstractCryptoProvider
- java.lang.Object
-
- io.jans.as.model.crypto.AbstractCryptoProvider
-
- Direct Known Subclasses:
AuthCryptoProvider,ElevenCryptoProvider
public abstract class AbstractCryptoProvider extends Object
- Version:
- October 26, 2021
- Author:
- Javier Rojas Blum, Sergey Manoylo
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.log4j.LoggerLOG
-
Constructor Summary
Constructors Constructor Description AbstractCryptoProvider()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckKeyExpiration(String alias, Long expirationTime)abstract booleancontainsKey(String keyId)abstract booleandeleteKey(String keyId)static 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)io.jans.eleven.model.JwksRequestParamgetJwksRequestParam(org.json.JSONObject jwkJsonObject)StringgetKeyId(JSONWebKeySet jsonWebKeySet, Algorithm algorithm, Use use, KeyOpsType keyOps)intgetKeyRegenerationIntervalInDays()List<String>getKeys()abstract PrivateKeygetPrivateKey(String keyId)abstract PublicKeygetPublicKey(String alias)PublicKeygetPublicKey(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)
-
-
-
Method Detail
-
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
public abstract boolean deleteKey(String keyId) throws CryptoProviderException
- Throws:
CryptoProviderException
-
containsKey
public abstract boolean containsKey(String keyId)
-
getPrivateKey
public abstract PrivateKey getPrivateKey(String keyId) throws CryptoProviderException
- Throws:
CryptoProviderException
-
getPublicKey
public abstract PublicKey getPublicKey(String alias) throws CryptoProviderException
- Throws:
CryptoProviderException
-
getKeyId
public String getKeyId(JSONWebKeySet jsonWebKeySet, Algorithm algorithm, Use use, KeyOpsType keyOps) throws CryptoProviderException
- Throws:
CryptoProviderException
-
getJwksRequestParam
public io.jans.eleven.model.JwksRequestParam getJwksRequestParam(org.json.JSONObject jwkJsonObject)
-
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
-
getKeyRegenerationIntervalInDays
public int getKeyRegenerationIntervalInDays()
-
setKeyRegenerationIntervalInDays
public void setKeyRegenerationIntervalInDays(int keyRegenerationIntervalInDays)
-
-