Package io.jans.as.server.service
Class ServerCryptoProvider
- java.lang.Object
-
- io.jans.as.model.crypto.AbstractCryptoProvider
-
- io.jans.as.server.service.ServerCryptoProvider
-
public class ServerCryptoProvider extends io.jans.as.model.crypto.AbstractCryptoProvider
- Author:
- Yuriy Zabrovarnyy
-
-
Constructor Summary
Constructors Constructor Description ServerCryptoProvider(io.jans.as.model.crypto.AbstractCryptoProvider cryptoProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(String keyId)
boolean
deleteKey(String keyId)
org.json.JSONObject
generateKey(io.jans.as.model.jwk.Algorithm algorithm, Long expirationTime)
org.json.JSONObject
generateKey(io.jans.as.model.jwk.Algorithm algorithm, Long expirationTime, int keyLength)
org.json.JSONObject
generateKey(io.jans.as.model.jwk.Algorithm algorithm, Long expirationTime, int keyLength, io.jans.as.model.jwk.KeyOpsType keyOpsType)
String
getKeyId(io.jans.as.model.jwk.JSONWebKeySet jsonWebKeySet, io.jans.as.model.jwk.Algorithm algorithm, io.jans.as.model.jwk.Use use, io.jans.as.model.jwk.KeyOpsType keyOps)
PrivateKey
getPrivateKey(String keyId)
PublicKey
getPublicKey(String keyId)
String
sign(String signingInput, String keyId, String sharedSecret, io.jans.as.model.crypto.signature.SignatureAlgorithm signatureAlgorithm)
boolean
verifySignature(String signingInput, String encodedSignature, String keyId, org.json.JSONObject jwks, String sharedSecret, io.jans.as.model.crypto.signature.SignatureAlgorithm signatureAlgorithm)
-
-
-
Method Detail
-
getKeyId
public String getKeyId(io.jans.as.model.jwk.JSONWebKeySet jsonWebKeySet, io.jans.as.model.jwk.Algorithm algorithm, io.jans.as.model.jwk.Use use, io.jans.as.model.jwk.KeyOpsType keyOps) throws io.jans.as.model.exception.CryptoProviderException
- Overrides:
getKeyId
in classio.jans.as.model.crypto.AbstractCryptoProvider
- Throws:
io.jans.as.model.exception.CryptoProviderException
-
generateKey
public org.json.JSONObject generateKey(io.jans.as.model.jwk.Algorithm algorithm, Long expirationTime, int keyLength) throws io.jans.as.model.exception.CryptoProviderException
- Specified by:
generateKey
in classio.jans.as.model.crypto.AbstractCryptoProvider
- Throws:
io.jans.as.model.exception.CryptoProviderException
-
generateKey
public org.json.JSONObject generateKey(io.jans.as.model.jwk.Algorithm algorithm, Long expirationTime, int keyLength, io.jans.as.model.jwk.KeyOpsType keyOpsType) throws io.jans.as.model.exception.CryptoProviderException
- Specified by:
generateKey
in classio.jans.as.model.crypto.AbstractCryptoProvider
- Throws:
io.jans.as.model.exception.CryptoProviderException
-
generateKey
public org.json.JSONObject generateKey(io.jans.as.model.jwk.Algorithm algorithm, Long expirationTime) throws io.jans.as.model.exception.CryptoProviderException
- Specified by:
generateKey
in classio.jans.as.model.crypto.AbstractCryptoProvider
- Throws:
io.jans.as.model.exception.CryptoProviderException
-
sign
public String sign(String signingInput, String keyId, String sharedSecret, io.jans.as.model.crypto.signature.SignatureAlgorithm signatureAlgorithm) throws io.jans.as.model.exception.CryptoProviderException
- Specified by:
sign
in classio.jans.as.model.crypto.AbstractCryptoProvider
- Throws:
io.jans.as.model.exception.CryptoProviderException
-
verifySignature
public boolean verifySignature(String signingInput, String encodedSignature, String keyId, org.json.JSONObject jwks, String sharedSecret, io.jans.as.model.crypto.signature.SignatureAlgorithm signatureAlgorithm) throws io.jans.as.model.exception.CryptoProviderException
- Specified by:
verifySignature
in classio.jans.as.model.crypto.AbstractCryptoProvider
- Throws:
io.jans.as.model.exception.CryptoProviderException
-
deleteKey
public boolean deleteKey(String keyId) throws io.jans.as.model.exception.CryptoProviderException
- Specified by:
deleteKey
in classio.jans.as.model.crypto.AbstractCryptoProvider
- Throws:
io.jans.as.model.exception.CryptoProviderException
-
containsKey
public boolean containsKey(String keyId)
- Specified by:
containsKey
in classio.jans.as.model.crypto.AbstractCryptoProvider
-
getPrivateKey
public PrivateKey getPrivateKey(String keyId) throws io.jans.as.model.exception.CryptoProviderException
- Specified by:
getPrivateKey
in classio.jans.as.model.crypto.AbstractCryptoProvider
- Throws:
io.jans.as.model.exception.CryptoProviderException
-
-