Class 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)  
      • Methods inherited from class io.jans.as.model.crypto.AbstractCryptoProvider

        checkKeyExpiration, generateJwks, getJwksRequestParam, getKeyRegenerationIntervalInDays, getKeys, getPublicKey, setKeyRegenerationIntervalInDays
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ServerCryptoProvider

        public ServerCryptoProvider​(io.jans.as.model.crypto.AbstractCryptoProvider cryptoProvider)
    • 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 class io.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 class io.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 class io.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 class io.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 class io.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 class io.jans.as.model.crypto.AbstractCryptoProvider
        Throws:
        io.jans.as.model.exception.CryptoProviderException
      • containsKey

        public boolean containsKey​(java.lang.String keyId)
        Specified by:
        containsKey in class io.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 class io.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 class io.jans.as.model.crypto.AbstractCryptoProvider
        Throws:
        io.jans.as.model.exception.CryptoProviderException