Class RsaKeyStoreHelper
- java.lang.Object
-
- de.hybris.platform.oauth2.jwt.util.RsaKeyStoreHelper
-
- All Implemented Interfaces:
KeyStoreHelper
public class RsaKeyStoreHelper extends java.lang.Object implements KeyStoreHelper
The implementation of KeyStoreHelper that can work with RSA key stores.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_INSTANCE_TYPE
-
Constructor Summary
Constructors Constructor Description RsaKeyStoreHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.security.KeyStoregetKeyStore(java.io.InputStream inputStream, java.lang.String password)Gets the key store.java.security.KeyStoregetKeyStore(java.lang.String instanceType, java.io.InputStream inputStream, java.lang.String password)Gets the key store.java.lang.StringgetModulusAsBase64String(byte[] modulus)Gets Modulus as a Base64 encoded string.java.security.interfaces.RSAPrivateKeygetPrivateKey(java.security.KeyStore keyStore, java.lang.String alias, java.lang.String password)Gets the private key.java.lang.StringgetPublicExponentAsBase64String(byte[] publicExponent)Gets Public Exponent as a Base64 encoded string.java.security.interfaces.RSAPublicKeygetPublicKey(java.security.KeyStore keyStore, java.lang.String alias)Gets the public key.org.springframework.security.jwt.crypto.sign.SignergetSigner(java.lang.String instanceType, java.io.InputStream inputStream, java.lang.String alias, java.lang.String password)Gets the signer.
-
-
-
Field Detail
-
DEFAULT_INSTANCE_TYPE
public static final java.lang.String DEFAULT_INSTANCE_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getKeyStore
public java.security.KeyStore getKeyStore(java.io.InputStream inputStream, java.lang.String password) throws KeyStoreProcessingExceptionDescription 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 java.security.KeyStore getKeyStore(java.lang.String instanceType, java.io.InputStream inputStream, java.lang.String password) throws KeyStoreProcessingExceptionDescription 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
public java.lang.String getModulusAsBase64String(byte[] modulus)
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
public java.lang.String getPublicExponentAsBase64String(byte[] publicExponent)
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 java.security.interfaces.RSAPrivateKey getPrivateKey(java.security.KeyStore keyStore, java.lang.String alias, java.lang.String password) throws KeyStoreProcessingExceptionDescription 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 java.security.interfaces.RSAPublicKey getPublicKey(java.security.KeyStore keyStore, java.lang.String alias) throws KeyStoreProcessingExceptionDescription 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(java.lang.String instanceType, java.io.InputStream inputStream, java.lang.String alias, java.lang.String password) throws KeyStoreProcessingExceptionDescription 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
-
-