public class KeyStoreCallbackHandler extends AbstractWsPasswordCallbackHandler implements org.springframework.beans.factory.InitializingBean
KeyStores to handle cryptographic callbacks. Allows for
specific key stores to be set for various cryptographic operations.KeyStoreFactoryBeanlogger| Constructor and Description |
|---|
KeyStoreCallbackHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected void |
handleDecrypt(org.apache.wss4j.common.ext.WSPasswordCallback callback)
Invoked when the callback has a
WSPasswordCallback.DECRYPT usage. |
protected void |
handleSecretKey(org.apache.wss4j.common.ext.WSPasswordCallback callback)
Invoked when the callback has a
WSPasswordCallback.SECRET_KEY usage. |
protected void |
loadDefaultKeyStore()
Loads the key store indicated by system properties.
|
void |
setKeyStore(KeyStore keyStore)
Sets the key store to use if a symmetric key name is embedded.
|
void |
setPrivateKeyPassword(String privateKeyPassword)
Sets the password used to retrieve private keys from the keystore.
|
void |
setSymmetricKeyPassword(String symmetricKeyPassword)
Sets the password used to retrieve keys from the symmetric keystore.
|
handleCleanup, handleCustomToken, handleInternal, handleSecurityContextToken, handleSignature, handleUsernameToken, handleUsernameTokenPrincipalhandleprotected void handleDecrypt(org.apache.wss4j.common.ext.WSPasswordCallback callback)
throws IOException,
UnsupportedCallbackException
WSPasswordCallback.DECRYPT usage.
This method is invoked when WSS4J needs a password to get the private key of the identifier (username) from the keystore. WSS4J uses this private key to
decrypt the session (symmetric) key. Because the encryption method uses the public key to encrypt the session key
it needs no password (a public key is usually not protected by a password).
Default implementation throws an UnsupportedCallbackException.
handleDecrypt in class AbstractWsPasswordCallbackHandlerIOExceptionUnsupportedCallbackExceptionprotected void handleSecretKey(org.apache.wss4j.common.ext.WSPasswordCallback callback)
throws IOException,
UnsupportedCallbackException
WSPasswordCallback.SECRET_KEY usage.
Default implementation throws an UnsupportedCallbackException.
handleSecretKey in class AbstractWsPasswordCallbackHandlerIOExceptionUnsupportedCallbackExceptionpublic void setKeyStore(KeyStore keyStore)
public void setPrivateKeyPassword(String privateKeyPassword)
public void setSymmetricKeyPassword(String symmetricKeyPassword)
setPrivateKeyPassword(String)public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionprotected void loadDefaultKeyStore()
KeyStoreUtils.loadDefaultKeyStore().Copyright © 2020 Pivotal Software. All rights reserved.