org.apache.servicemix.soap.handlers.security
Class StandaloneCrypto

java.lang.Object
  extended by org.apache.servicemix.soap.handlers.security.BaseCrypto
      extended by org.apache.servicemix.soap.handlers.security.StandaloneCrypto
All Implemented Interfaces:
org.apache.ws.security.components.crypto.Crypto

public class StandaloneCrypto
extends BaseCrypto


Constructor Summary
StandaloneCrypto()
           
 
Method Summary
protected  java.lang.String[] getAliases()
           
 byte[] getBytesFromCertificates(java.security.cert.X509Certificate[] certs)
           
protected  java.security.cert.Certificate getCertificate(java.lang.String alias)
           
protected  java.lang.String getCertificateAlias(java.security.cert.Certificate cert)
           
protected  java.security.cert.Certificate[] getCertificateChain(java.lang.String alias)
           
 java.security.cert.X509Certificate[] getCertificatesFromBytes(byte[] data)
           
 java.lang.String getCryptoProvider()
           
 java.lang.String getDefaultX509Identifier()
           
 java.lang.String getKeyPassword()
           
 java.lang.String getKeyStorePassword()
           
 java.lang.String getKeyStoreType()
           
 org.springframework.core.io.Resource getKeyStoreUrl()
           
 java.security.PrivateKey getPrivateKey(java.lang.String alias, java.lang.String password)
          Gets the private key identified by alias and password.
 java.security.PrivateKey getPrivateKey(java.security.cert.X509Certificate certificate, javax.security.auth.callback.CallbackHandler callbackHandler)
           
protected  java.lang.String[] getTrustCertificates()
           
 java.security.cert.X509Certificate[] getX509Certificates(org.apache.ws.security.components.crypto.CryptoType cryptoType)
           
 java.lang.String getX509Identifier(java.security.cert.X509Certificate cert)
           
 java.security.KeyStore loadKeyStore()
          Loads the the keystore.
 void setCertificateFactory(java.lang.String provider, java.security.cert.CertificateFactory certFactory)
           
 void setCryptoProvider(java.lang.String provider)
           
 void setDefaultX509Identifier(java.lang.String identifier)
           
 void setKeyPassword(java.lang.String keyPassword)
           
 void setKeyStorePassword(java.lang.String keyStorePassword)
           
 void setKeyStoreType(java.lang.String keyStoreType)
           
 void setKeyStoreUrl(org.springframework.core.io.Resource keyStoreUrl)
           
 boolean verifyTrust(java.security.PublicKey publicKey)
           
 boolean verifyTrust(java.security.cert.X509Certificate[] certs)
           
 
Methods inherited from class org.apache.servicemix.soap.handlers.security.BaseCrypto
getAliasesForDN, getAliasForX509Cert, getAliasForX509Cert, getAliasForX509Cert, getAliasForX509Cert, getAliasForX509CertThumb, getCertificateChainOrCertificate, getCertificateData, getCertificateFactory, getCertificates, getDefaultX509Alias, getKeyStore, getProvider, getSKIBytesFromCert, getX509Certificates, loadCertificate, setDefaultX509Alias, setProvider, splitAndTrim, validateCertPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandaloneCrypto

public StandaloneCrypto()
Method Detail

getKeyPassword

public java.lang.String getKeyPassword()
Returns:
the keyPassword

setKeyPassword

public void setKeyPassword(java.lang.String keyPassword)
Parameters:
keyPassword - the keyPassword to set

getKeyStorePassword

public java.lang.String getKeyStorePassword()
Returns:
the keyStorePassword

setKeyStorePassword

public void setKeyStorePassword(java.lang.String keyStorePassword)
Parameters:
keyStorePassword - the keyStorePassword to set

getKeyStoreType

public java.lang.String getKeyStoreType()
Returns:
the keyStoreType

setKeyStoreType

public void setKeyStoreType(java.lang.String keyStoreType)
Parameters:
keyStoreType - the keyStoreType to set

getKeyStoreUrl

public org.springframework.core.io.Resource getKeyStoreUrl()
Returns:
the keyStoreUrl

setKeyStoreUrl

public void setKeyStoreUrl(org.springframework.core.io.Resource keyStoreUrl)
Parameters:
keyStoreUrl - the keyStoreUrl to set

getAliases

protected java.lang.String[] getAliases()
                                 throws java.security.KeyStoreException
Specified by:
getAliases in class BaseCrypto
Throws:
java.security.KeyStoreException

getCertificate

protected java.security.cert.Certificate getCertificate(java.lang.String alias)
                                                 throws java.security.KeyStoreException
Specified by:
getCertificate in class BaseCrypto
Throws:
java.security.KeyStoreException

getCertificateAlias

protected java.lang.String getCertificateAlias(java.security.cert.Certificate cert)
                                        throws java.security.KeyStoreException
Specified by:
getCertificateAlias in class BaseCrypto
Throws:
java.security.KeyStoreException

getCertificateChain

protected java.security.cert.Certificate[] getCertificateChain(java.lang.String alias)
                                                        throws java.security.KeyStoreException
Specified by:
getCertificateChain in class BaseCrypto
Throws:
java.security.KeyStoreException

getPrivateKey

public java.security.PrivateKey getPrivateKey(java.lang.String alias,
                                              java.lang.String password)
                                       throws org.apache.ws.security.WSSecurityException
Description copied from class: BaseCrypto
Gets the private key identified by alias and password.

Specified by:
getPrivateKey in interface org.apache.ws.security.components.crypto.Crypto
Specified by:
getPrivateKey in class BaseCrypto
Parameters:
alias - The alias (KeyStore) of the key owner
password - The password needed to access the private key
Returns:
The private key
Throws:
org.apache.ws.security.WSSecurityException

getTrustCertificates

protected java.lang.String[] getTrustCertificates()
                                           throws java.security.KeyStoreException
Specified by:
getTrustCertificates in class BaseCrypto
Throws:
java.security.KeyStoreException

loadKeyStore

public java.security.KeyStore loadKeyStore()
                                    throws java.security.KeyStoreException
Loads the the keystore.

Throws:
org.apache.ws.security.components.crypto.CredentialException
java.security.KeyStoreException

getCryptoProvider

public java.lang.String getCryptoProvider()

setCryptoProvider

public void setCryptoProvider(java.lang.String provider)

getDefaultX509Identifier

public java.lang.String getDefaultX509Identifier()
                                          throws org.apache.ws.security.WSSecurityException
Throws:
org.apache.ws.security.WSSecurityException

setDefaultX509Identifier

public void setDefaultX509Identifier(java.lang.String identifier)

setCertificateFactory

public void setCertificateFactory(java.lang.String provider,
                                  java.security.cert.CertificateFactory certFactory)

getBytesFromCertificates

public byte[] getBytesFromCertificates(java.security.cert.X509Certificate[] certs)
                                throws org.apache.ws.security.WSSecurityException
Throws:
org.apache.ws.security.WSSecurityException

getCertificatesFromBytes

public java.security.cert.X509Certificate[] getCertificatesFromBytes(byte[] data)
                                                              throws org.apache.ws.security.WSSecurityException
Throws:
org.apache.ws.security.WSSecurityException

getX509Certificates

public java.security.cert.X509Certificate[] getX509Certificates(org.apache.ws.security.components.crypto.CryptoType cryptoType)
                                                         throws org.apache.ws.security.WSSecurityException
Throws:
org.apache.ws.security.WSSecurityException

getX509Identifier

public java.lang.String getX509Identifier(java.security.cert.X509Certificate cert)
                                   throws org.apache.ws.security.WSSecurityException
Throws:
org.apache.ws.security.WSSecurityException

getPrivateKey

public java.security.PrivateKey getPrivateKey(java.security.cert.X509Certificate certificate,
                                              javax.security.auth.callback.CallbackHandler callbackHandler)
                                       throws org.apache.ws.security.WSSecurityException
Throws:
org.apache.ws.security.WSSecurityException

verifyTrust

public boolean verifyTrust(java.security.cert.X509Certificate[] certs)
                    throws org.apache.ws.security.WSSecurityException
Throws:
org.apache.ws.security.WSSecurityException

verifyTrust

public boolean verifyTrust(java.security.PublicKey publicKey)
                    throws org.apache.ws.security.WSSecurityException
Throws:
org.apache.ws.security.WSSecurityException


Copyright © 2005-2011 FuseSource. All Rights Reserved.