Package org.gluu.oxauth.service
Class ServerCryptoProvider
- java.lang.Object
-
- org.gluu.oxauth.model.crypto.AbstractCryptoProvider
-
- org.gluu.oxauth.service.ServerCryptoProvider
-
public class ServerCryptoProvider extends AbstractCryptoProvider
- Author:
- Yuriy Zabrovarnyy
-
-
Constructor Summary
Constructors Constructor Description ServerCryptoProvider(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(Algorithm algorithm, java.lang.Long expirationTime, Use use)
org.json.JSONObject
generateKey(Algorithm algorithm, java.lang.Long expirationTime, Use use, int keyLength)
java.lang.String
getKeyId(JSONWebKeySet jsonWebKeySet, Algorithm algorithm, Use use)
java.security.PrivateKey
getPrivateKey(java.lang.String keyId)
java.lang.String
sign(java.lang.String signingInput, java.lang.String keyId, java.lang.String sharedSecret, SignatureAlgorithm signatureAlgorithm)
boolean
verifySignature(java.lang.String signingInput, java.lang.String encodedSignature, java.lang.String keyId, org.json.JSONObject jwks, java.lang.String sharedSecret, SignatureAlgorithm signatureAlgorithm)
-
Methods inherited from class org.gluu.oxauth.model.crypto.AbstractCryptoProvider
checkKeyExpiration, generateJwks, generateKey, getKeyRegenerationIntervalInDays, getKeys, getPublicKey, setKeyRegenerationIntervalInDays
-
-
-
-
Constructor Detail
-
ServerCryptoProvider
public ServerCryptoProvider(AbstractCryptoProvider cryptoProvider)
-
-
Method Detail
-
getKeyId
public java.lang.String getKeyId(JSONWebKeySet jsonWebKeySet, Algorithm algorithm, Use use) throws java.lang.Exception
- Overrides:
getKeyId
in classAbstractCryptoProvider
- Throws:
java.lang.Exception
-
generateKey
public org.json.JSONObject generateKey(Algorithm algorithm, java.lang.Long expirationTime, Use use) throws java.lang.Exception
- Specified by:
generateKey
in classAbstractCryptoProvider
- Throws:
java.lang.Exception
-
generateKey
public org.json.JSONObject generateKey(Algorithm algorithm, java.lang.Long expirationTime, Use use, int keyLength) throws java.lang.Exception
- Specified by:
generateKey
in classAbstractCryptoProvider
- Throws:
java.lang.Exception
-
sign
public java.lang.String sign(java.lang.String signingInput, java.lang.String keyId, java.lang.String sharedSecret, SignatureAlgorithm signatureAlgorithm) throws java.lang.Exception
- Specified by:
sign
in classAbstractCryptoProvider
- Throws:
java.lang.Exception
-
verifySignature
public boolean verifySignature(java.lang.String signingInput, java.lang.String encodedSignature, java.lang.String keyId, org.json.JSONObject jwks, java.lang.String sharedSecret, SignatureAlgorithm signatureAlgorithm) throws java.lang.Exception
- Specified by:
verifySignature
in classAbstractCryptoProvider
- Throws:
java.lang.Exception
-
deleteKey
public boolean deleteKey(java.lang.String keyId) throws java.lang.Exception
- Specified by:
deleteKey
in classAbstractCryptoProvider
- Throws:
java.lang.Exception
-
containsKey
public boolean containsKey(java.lang.String keyId)
- Specified by:
containsKey
in classAbstractCryptoProvider
-
getPrivateKey
public java.security.PrivateKey getPrivateKey(java.lang.String keyId) throws java.lang.Exception
- Specified by:
getPrivateKey
in classAbstractCryptoProvider
- Throws:
java.lang.Exception
-
-