Class RsaKeyStoreHelper
java.lang.Object
de.hybris.platform.oauth2.jwt.util.RsaKeyStoreHelper
- All Implemented Interfaces:
KeyStoreHelper
The implementation of KeyStoreHelper that can work with RSA key stores.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetKeyStore(InputStream inputStream, String password) Gets the key store.getKeyStore(String instanceType, InputStream inputStream, String password) Gets the key store.getModulusAsBase64String(byte[] modulus) Gets Modulus as a Base64 encoded string.getPrivateKey(KeyStore keyStore, String alias, String password) Gets the private key.getPublicExponentAsBase64String(byte[] publicExponent) Gets Public Exponent as a Base64 encoded string.getPublicKey(KeyStore keyStore, String alias) Gets the public key.org.springframework.security.jwt.crypto.sign.SignergetSigner(String instanceType, InputStream inputStream, String alias, String password) Gets the signer.
-
Field Details
-
DEFAULT_INSTANCE_TYPE
- See Also:
-
-
Constructor Details
-
RsaKeyStoreHelper
public RsaKeyStoreHelper()
-
-
Method Details
-
getKeyStore
public KeyStore getKeyStore(InputStream inputStream, String password) throws KeyStoreProcessingException Description copied from interface:KeyStoreHelperGets the key store.- Specified by:
getKeyStorein interfaceKeyStoreHelper- Parameters:
inputStream- the input streampassword- the password- Returns:
- the key store
- Throws:
KeyStoreProcessingException- the key store processing exception
-
getKeyStore
public KeyStore getKeyStore(String instanceType, InputStream inputStream, String password) throws KeyStoreProcessingException Description copied from interface:KeyStoreHelperGets the key store.- Specified by:
getKeyStorein interfaceKeyStoreHelper- Parameters:
instanceType- the instance typeinputStream- the input streampassword- the password- Returns:
- the key store
- Throws:
KeyStoreProcessingException- the key store processing exception
-
getModulusAsBase64String
Description copied from interface:KeyStoreHelperGets Modulus as a Base64 encoded string.- Specified by:
getModulusAsBase64Stringin interfaceKeyStoreHelper- Parameters:
modulus- the modulus- Returns:
- the modulus as Base64 string
-
getPublicExponentAsBase64String
Description copied from interface:KeyStoreHelperGets Public Exponent as a Base64 encoded string.- Specified by:
getPublicExponentAsBase64Stringin interfaceKeyStoreHelper- Parameters:
publicExponent- the publicExponent- Returns:
- the publicExponent as Base64 string
-
getPrivateKey
public RSAPrivateKey getPrivateKey(KeyStore keyStore, String alias, String password) throws KeyStoreProcessingException Description copied from interface:KeyStoreHelperGets the private key.- Specified by:
getPrivateKeyin interfaceKeyStoreHelper- Parameters:
keyStore- the key storealias- the aliaspassword- the password- Returns:
- the private key
- Throws:
KeyStoreProcessingException- the key store processing exception
-
getPublicKey
public RSAPublicKey getPublicKey(KeyStore keyStore, String alias) throws KeyStoreProcessingException Description copied from interface:KeyStoreHelperGets the public key.- Specified by:
getPublicKeyin interfaceKeyStoreHelper- Parameters:
keyStore- the key storealias- the alias- Returns:
- the public key
- Throws:
KeyStoreProcessingException- the key store processing exception
-
getSigner
public org.springframework.security.jwt.crypto.sign.Signer getSigner(String instanceType, InputStream inputStream, String alias, String password) throws KeyStoreProcessingException Description copied from interface:KeyStoreHelperGets the signer.- Specified by:
getSignerin interfaceKeyStoreHelper- Parameters:
instanceType- the instance typeinputStream- the input streamalias- the aliaspassword- the password- Returns:
- the signer
- Throws:
KeyStoreProcessingException- the key store processing exception
-