public class CommonUtil extends Object
Constructor and Description |
---|
CommonUtil() |
Modifier and Type | Method and Description |
---|---|
static X509Certificate |
getCertificateByAlias(org.apache.ws.security.components.crypto.Crypto crypto,
String alias)
Gets the certificates chain by alias.
|
static X509Certificate[] |
getCertificatesByAlias(org.apache.ws.security.components.crypto.Crypto crypto,
String alias)
Gets the certificates chain by alias.
|
static org.apache.ws.security.components.crypto.Crypto |
getCrypto(Properties properties,
ClassLoader classLoader)
Constructs crypto configuration based on the given properties.
|
static org.apache.ws.security.components.crypto.Crypto |
getCrypto(String propertiesFile,
ClassLoader classLoader)
Constructs crypto configuration based on the given properties.
|
static byte[] |
getDecryptedBytes(CallbackHandler callbackHandler,
org.apache.ws.security.components.crypto.Crypto crypto,
Node encryptedKeyElement)
Decrypts the EncryptedKey element and returns the secret that was used.
|
static Document |
getOMDOMDocument()
This method creates a DOM compatible Axiom document.
|
public static Document getOMDOMDocument() throws TrustException
TrustException
- If an error occurred while creating the Document.public static X509Certificate getCertificateByAlias(org.apache.ws.security.components.crypto.Crypto crypto, String alias) throws TrustException
crypto
- Crypto to lookup certificate.alias
- Alias name.TrustException
- If an error occurred
while retrieving the certificate or if no certificates are found for given alias.public static X509Certificate[] getCertificatesByAlias(org.apache.ws.security.components.crypto.Crypto crypto, String alias) throws TrustException
crypto
- Crypto to lookup certificate.alias
- Alias name.TrustException
- If an error occurred
while retrieving the certificate.public static byte[] getDecryptedBytes(CallbackHandler callbackHandler, org.apache.ws.security.components.crypto.Crypto crypto, Node encryptedKeyElement) throws org.apache.ws.security.WSSecurityException
callbackHandler
- Callback handler to pass to WSS4J framework.crypto
- To get private key information.encryptedKeyElement
- The encrypted Key element.org.apache.ws.security.WSSecurityException
- If an error is occurred while decrypting the element.public static org.apache.ws.security.components.crypto.Crypto getCrypto(Properties properties, ClassLoader classLoader) throws TrustException
properties
- Crypto configuration properties.classLoader
- Class loader used to create provider.TrustException
- If an error occurred while creating the Crypto object.public static org.apache.ws.security.components.crypto.Crypto getCrypto(String propertiesFile, ClassLoader classLoader) throws TrustException
propertiesFile
- Crypto configuration properties file name.classLoader
- Class loader used to create provider.TrustException
- If an error occurred while creating the Crypto object.Copyright © Apache Software Foundation. All Rights Reserved.