Interface KeyStoreHelper

  • All Known Implementing Classes:
    RsaKeyStoreHelper

    public interface KeyStoreHelper
    The Interface KeyStoreHelper for extracting private/public keys, keystore and generating signer from a file (as an input stream).
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.security.KeyStore getKeyStore​(java.io.InputStream inputStream, java.lang.String password)
      Gets the key store.
      java.security.KeyStore getKeyStore​(java.lang.String instanceType, java.io.InputStream inputStream, java.lang.String password)
      Gets the key store.
      java.lang.String getModulusAsBase64String​(byte[] modulus)
      Gets Modulus as a Base64 encoded string.
      java.security.PrivateKey getPrivateKey​(java.security.KeyStore keyStore, java.lang.String alias, java.lang.String password)
      Gets the private key.
      java.lang.String getPublicExponentAsBase64String​(byte[] publicExponent)
      Gets Public Exponent as a Base64 encoded string.
      java.security.PublicKey getPublicKey​(java.security.KeyStore keyStore, java.lang.String alias)
      Gets the public key.
      org.springframework.security.jwt.crypto.sign.Signer getSigner​(java.lang.String instanceType, java.io.InputStream inputStream, java.lang.String alias, java.lang.String password)
      Gets the signer.
    • Method Detail

      • getSigner

        org.springframework.security.jwt.crypto.sign.Signer getSigner​(java.lang.String instanceType,
                                                                      java.io.InputStream inputStream,
                                                                      java.lang.String alias,
                                                                      java.lang.String password)
                                                               throws KeyStoreProcessingException
        Gets the signer.
        Parameters:
        instanceType - the instance type
        inputStream - the input stream
        alias - the alias
        password - the password
        Returns:
        the signer
        Throws:
        KeyStoreProcessingException - the key store processing exception
      • getKeyStore

        java.security.KeyStore getKeyStore​(java.io.InputStream inputStream,
                                           java.lang.String password)
                                    throws KeyStoreProcessingException
        Gets the key store.
        Parameters:
        inputStream - the input stream
        password - the password
        Returns:
        the key store
        Throws:
        KeyStoreProcessingException - the key store processing exception
      • getPrivateKey

        java.security.PrivateKey getPrivateKey​(java.security.KeyStore keyStore,
                                               java.lang.String alias,
                                               java.lang.String password)
                                        throws KeyStoreProcessingException
        Gets the private key.
        Parameters:
        keyStore - the key store
        alias - the alias
        password - the password
        Returns:
        the private key
        Throws:
        KeyStoreProcessingException - the key store processing exception
      • getPublicKey

        java.security.PublicKey getPublicKey​(java.security.KeyStore keyStore,
                                             java.lang.String alias)
                                      throws KeyStoreProcessingException
        Gets the public key.
        Parameters:
        keyStore - the key store
        alias - the alias
        Returns:
        the public key
        Throws:
        KeyStoreProcessingException - the key store processing exception
      • getKeyStore

        java.security.KeyStore getKeyStore​(java.lang.String instanceType,
                                           java.io.InputStream inputStream,
                                           java.lang.String password)
                                    throws KeyStoreProcessingException
        Gets the key store.
        Parameters:
        instanceType - the instance type
        inputStream - the input stream
        password - the password
        Returns:
        the key store
        Throws:
        KeyStoreProcessingException - the key store processing exception
      • getModulusAsBase64String

        java.lang.String getModulusAsBase64String​(byte[] modulus)
        Gets Modulus as a Base64 encoded string.
        Parameters:
        modulus - the modulus
        Returns:
        the modulus as Base64 string
      • getPublicExponentAsBase64String

        java.lang.String getPublicExponentAsBase64String​(byte[] publicExponent)
        Gets Public Exponent as a Base64 encoded string.
        Parameters:
        publicExponent - the publicExponent
        Returns:
        the publicExponent as Base64 string