org.apache.ws.security.components.crypto
Class AbstractCrypto

java.lang.Object
  extended byorg.apache.ws.security.components.crypto.CryptoBase
      extended byorg.apache.ws.security.components.crypto.AbstractCrypto
All Implemented Interfaces:
Crypto
Direct Known Subclasses:
BouncyCastle, Merlin

public abstract class AbstractCrypto
extends CryptoBase

Created by IntelliJ IDEA. User: dims Date: Sep 15, 2005 Time: 9:50:40 AM To change this template use File | Settings | File Templates.


Field Summary
protected static java.security.cert.CertificateFactory certFact
           
protected  java.util.Properties properties
           
 
Fields inherited from class org.apache.ws.security.components.crypto.CryptoBase
cacerts, certFactMap, keystore
 
Constructor Summary
AbstractCrypto(java.util.Properties properties)
          Constructor
AbstractCrypto(java.util.Properties properties, java.lang.ClassLoader loader)
          This allows providing a custom class loader to load the resources, etc
 
Method Summary
protected  java.lang.String getCryptoProvider()
           
 java.lang.String getDefaultX509Alias()
          Retrieves the alias name of the default certificate which has been specified as a property.
 java.security.KeyStore load(java.io.InputStream input, java.lang.String storepass, java.lang.String provider, java.lang.String type)
          Loads the keystore from an InputStream .
 
Methods inherited from class org.apache.ws.security.components.crypto.CryptoBase
createKeyStoreErrorMessage, getAliasesForDN, getAliasForX509Cert, getAliasForX509Cert, getAliasForX509Cert, getAliasForX509Cert, getAliasForX509CertThumb, getCertificateData, getCertificateFactory, getCertificates, getKeyStore, getPrivateKey, getSKIBytesFromCert, getX509Certificates, loadCertificate, setKeyStore, splitAndTrim, validateCertPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

certFact

protected static java.security.cert.CertificateFactory certFact

properties

protected java.util.Properties properties
Constructor Detail

AbstractCrypto

public AbstractCrypto(java.util.Properties properties)
               throws CredentialException,
                      java.io.IOException
Constructor

Parameters:
properties -

AbstractCrypto

public AbstractCrypto(java.util.Properties properties,
                      java.lang.ClassLoader loader)
               throws CredentialException,
                      java.io.IOException
This allows providing a custom class loader to load the resources, etc

Parameters:
properties -
loader -
Throws:
CredentialException
java.io.IOException
Method Detail

load

public java.security.KeyStore load(java.io.InputStream input,
                                   java.lang.String storepass,
                                   java.lang.String provider,
                                   java.lang.String type)
                            throws CredentialException
Loads the keystore from an InputStream .

Parameters:
input - InputStream to read from
Throws:
CredentialException

getCryptoProvider

protected java.lang.String getCryptoProvider()
Specified by:
getCryptoProvider in class CryptoBase
Returns:
a crypto provider name. This operation should return null if the default crypto provider should be used.

getDefaultX509Alias

public java.lang.String getDefaultX509Alias()
Retrieves the alias name of the default certificate which has been specified as a property. This should be the certificate that is used for signature and encryption. This alias corresponds to the certificate that should be used whenever KeyInfo is not present in a signed or an encrypted message. May return null.

Returns:
alias name of the default X509 certificate


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.