Class BouncyCastle
- java.lang.Object
-
- org.apache.ws.security.components.crypto.AbstractCrypto
-
- org.apache.ws.security.components.crypto.BouncyCastle
-
- All Implemented Interfaces:
Crypto
public class BouncyCastle extends AbstractCrypto
JDK1.4 based implementation of Crypto (uses keystore).- Author:
- Davanum Srinivas (dims@yahoo.com).
-
-
Field Summary
-
Fields inherited from class org.apache.ws.security.components.crypto.AbstractCrypto
certFact, keystore, properties
-
-
Constructor Summary
Constructors Constructor Description BouncyCastle(java.util.Properties properties)
Constructor.BouncyCastle(java.util.Properties properties, java.lang.ClassLoader loader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getCertificateData(boolean reverse, java.security.cert.X509Certificate[] certs)
get a byte array given an array of X509 certificates.java.security.cert.X509Certificate[]
getX509Certificates(byte[] data, boolean reverse)
Construct an array of X509Certificate's from the byte array.boolean
validateCertPath(java.security.cert.X509Certificate[] certs)
Uses the CertPath API to validate a given certificate chain-
Methods inherited from class org.apache.ws.security.components.crypto.AbstractCrypto
getAliasesForDN, getAliasForX509Cert, getAliasForX509Cert, getAliasForX509Cert, getAliasForX509Cert, getAliasForX509CertThumb, getCertificateFactory, getCertificates, getDefaultX509Alias, getKeyStore, getPrivateKey, getSKIBytesFromCert, load, loadCertificate, setKeyStore
-
-
-
-
Constructor Detail
-
BouncyCastle
public BouncyCastle(java.util.Properties properties) throws CredentialException, java.io.IOException
Constructor.- Parameters:
properties
-- Throws:
CredentialException
java.io.IOException
-
BouncyCastle
public BouncyCastle(java.util.Properties properties, java.lang.ClassLoader loader) throws CredentialException, java.io.IOException
- Throws:
CredentialException
java.io.IOException
-
-
Method Detail
-
getX509Certificates
public java.security.cert.X509Certificate[] getX509Certificates(byte[] data, boolean reverse) throws WSSecurityException
Construct an array of X509Certificate's from the byte array.- Parameters:
data
- Thebyte
array containg the X509 datareverse
- If set the first certificate in input data will the last in the array- Returns:
- An array of X509 certificates, ordered according to the reverse flag
- Throws:
WSSecurityException
-
getCertificateData
public byte[] getCertificateData(boolean reverse, java.security.cert.X509Certificate[] certs) throws WSSecurityException
get a byte array given an array of X509 certificates.- Parameters:
reverse
- If set the first certificate in the array data will the last in the byte arraycerts
- The certificates to convert- Returns:
- The byte array for the certficates ordered according to the reverse flag
- Throws:
WSSecurityException
-
validateCertPath
public boolean validateCertPath(java.security.cert.X509Certificate[] certs) throws WSSecurityException
Uses the CertPath API to validate a given certificate chain- Parameters:
certs
- Certificate chain to validate- Returns:
- true if the certificate chain is valid, false otherwise
- Throws:
WSSecurityException
-
-