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(java.lang.String keyId)
boolean
deleteKey(java.lang.String keyId)
org.json.JSONObject
generateKey(io.jans.as.model.jwk.Algorithm algorithm, java.lang.Long expirationTime)
org.json.JSONObject
generateKey(io.jans.as.model.jwk.Algorithm algorithm, java.lang.Long expirationTime, int keyLength)
java.lang.String
getKeyId(io.jans.as.model.jwk.JSONWebKeySet jsonWebKeySet, io.jans.as.model.jwk.Algorithm algorithm, io.jans.as.model.jwk.Use use)
java.security.PrivateKey
getPrivateKey(java.lang.String keyId)
java.security.PublicKey
getPublicKey(java.lang.String keyId)
java.lang.String
sign(java.lang.String signingInput, java.lang.String keyId, java.lang.String sharedSecret, io.jans.as.model.crypto.signature.SignatureAlgorithm signatureAlgorithm)
boolean
verifySignature(java.lang.String signingInput, java.lang.String encodedSignature, java.lang.String keyId, org.json.JSONObject jwks, java.lang.String sharedSecret, io.jans.as.model.crypto.signature.SignatureAlgorithm signatureAlgorithm)
-
-
-
Method Detail
-
getKeyId
public java.lang.String getKeyId(io.jans.as.model.jwk.JSONWebKeySet jsonWebKeySet, io.jans.as.model.jwk.Algorithm algorithm, io.jans.as.model.jwk.Use use) 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, java.lang.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, java.lang.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 java.lang.String sign(java.lang.String signingInput, java.lang.String keyId, java.lang.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(java.lang.String signingInput, java.lang.String encodedSignature, java.lang.String keyId, org.json.JSONObject jwks, java.lang.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(java.lang.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(java.lang.String keyId)
- Specified by:
containsKey
in classio.jans.as.model.crypto.AbstractCryptoProvider
-
getPrivateKey
public java.security.PrivateKey getPrivateKey(java.lang.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
-
getPublicKey
public java.security.PublicKey getPublicKey(java.lang.String keyId) throws io.jans.as.model.exception.CryptoProviderException
- Specified by:
getPublicKey
in classio.jans.as.model.crypto.AbstractCryptoProvider
- Throws:
io.jans.as.model.exception.CryptoProviderException
-
-