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 void
checkKeyExpiration
(String alias, Long expirationTime) abstract boolean
containsKey
(String keyId) abstract boolean
static org.json.JSONObject
generateJwks
(AbstractCryptoProvider cryptoProvider, AppConfiguration configuration) abstract org.json.JSONObject
generateKey
(Algorithm algorithm, Long expirationTime) abstract org.json.JSONObject
generateKey
(Algorithm algorithm, Long expirationTime, int keyLength) abstract org.json.JSONObject
generateKey
(Algorithm algorithm, Long expirationTime, int keyLength, KeyOpsType keyOpsType) getKeyId
(JSONWebKeySet jsonWebKeySet, Algorithm algorithm, Use use, KeyOpsType keyOps) int
getKeys()
abstract PrivateKey
getPrivateKey
(String keyId) abstract PublicKey
getPublicKey
(String alias) getPublicKey
(String alias, org.json.JSONObject jwks, Algorithm requestedAlgorithm) void
setKeyRegenerationIntervalInDays
(int keyRegenerationIntervalInDays) abstract String
sign
(String signingInput, String keyId, String sharedSecret, SignatureAlgorithm signatureAlgorithm) abstract boolean
verifySignature
(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)
-