|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.kth.pdc.grid.services.components.PCCrypto
public class PCCrypto
JDK1.4 based implementation of Crypto (uses keystore).
| Field Summary | |
|---|---|
protected static CertificateFactory |
certFact
|
| Constructor Summary | |
|---|---|
PCCrypto()
Constructor. |
|
| Method Summary | |
|---|---|
String[] |
getAliasesForDN(String subjectDN)
Lookup X509 Certificates in the keystore according to a given DN of the subject of the certificate |
String |
getAliasForX509Cert(byte[] skiBytes)
Lookup a X509 Certificate in the keystore according to a given SubjectKeyIdentifier. |
String |
getAliasForX509Cert(Certificate cert)
Return a X509 Certificate alias in the keystore according to a given Certificate |
String |
getAliasForX509Cert(String issuer)
Lookup a X509 Certificate in the keystore according to a given the issuer of a Certficate. |
String |
getAliasForX509Cert(String issuer,
BigInteger serialNumber)
Search a X509 Certificate in the keystore according to a given serial number and the issuer of a Certficate. |
String |
getAliasForX509CertThumb(byte[] thumb)
Lookup a X509 Certificate in the keystore according to a given Thumbprint. |
String |
getAliasKrbKey()
|
byte[] |
getCertificateData(boolean reverse,
X509Certificate[] certs)
get a byte array given an array of X509 certificates. |
CertificateFactory |
getCertificateFactory()
Gets the CertificateFactory instantiated by the underlying implementation |
X509Certificate[] |
getCertificates(String alias)
get the list of certificates for a given alias. |
String |
getDefaultX509Alias()
Retrieves the alias name of the default certificate which has been specified as a property. |
KeyStore |
getKeyStore()
Gets the Keystore that was loaded by the underlying implementation |
String |
getPasswordKrbKey()
|
PrivateKey |
getPrivateKey(String alias,
String password)
Gets the private key identified by alias> and |
byte[] |
getSKIBytesFromCert(X509Certificate cert)
Reads the SubjectKeyIdentifier information from the certificate. |
X509Certificate[] |
getX509Certificates(byte[] data,
boolean reverse)
Construct an array of X509Certificate's from the byte array. |
X509Certificate |
loadCertificate(InputStream in)
load a X509Certificate from the input stream. |
boolean |
validateCertPath(X509Certificate[] certs)
Overridden because there's a bug in the base class where they don't use the provider variant for the certificate validator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static CertificateFactory certFact
| Constructor Detail |
|---|
public PCCrypto()
properties -
CredentialException
IOException| Method Detail |
|---|
public X509Certificate[] getX509Certificates(byte[] data,
boolean reverse)
throws org.apache.ws.security.WSSecurityException
getX509Certificates in interface org.apache.ws.security.components.crypto.Cryptodata - The byte array containg the X509 datareverse - If set the first certificate in input data will
the last in the array
org.apache.ws.security.WSSecurityException
public byte[] getCertificateData(boolean reverse,
X509Certificate[] certs)
throws org.apache.ws.security.WSSecurityException
getCertificateData in interface org.apache.ws.security.components.crypto.Cryptoreverse - If set the first certificate in the array data will
the last in the byte arraycerts - The certificates to convert
org.apache.ws.security.WSSecurityException
public boolean validateCertPath(X509Certificate[] certs)
throws org.apache.ws.security.WSSecurityException
validateCertPath in interface org.apache.ws.security.components.crypto.Cryptocerts - Certificate chain to validate
org.apache.ws.security.WSSecurityException
public X509Certificate loadCertificate(InputStream in)
throws org.apache.ws.security.WSSecurityException
loadCertificate in interface org.apache.ws.security.components.crypto.Cryptoin - The InputStream array containg the X509 data
org.apache.ws.security.WSSecurityException
public PrivateKey getPrivateKey(String alias,
String password)
throws Exception
alias> and password.
- Specified by:
getPrivateKey in interface org.apache.ws.security.components.crypto.Crypto
- Parameters:
alias - The alias (KeyStore) of the key ownerpassword - The password needed to access the private key
- Returns:
- The private key
- Throws:
Exception
public X509Certificate[] getCertificates(String alias)
throws org.apache.ws.security.WSSecurityException
getCertificates in interface org.apache.ws.security.components.crypto.Cryptoalias - Lookup certificate chain for this alias
org.apache.ws.security.WSSecurityException
public String getAliasForX509Cert(Certificate cert)
throws org.apache.ws.security.WSSecurityException
getAliasForX509Cert in interface org.apache.ws.security.components.crypto.Cryptocert - The certificate to lookup
org.apache.ws.security.WSSecurityException
public String getAliasForX509Cert(String issuer)
throws org.apache.ws.security.WSSecurityException
getAliasForX509Cert in interface org.apache.ws.security.components.crypto.Cryptoissuer - The issuer's name for the certificate
org.apache.ws.security.WSSecurityException
public String getAliasForX509Cert(String issuer,
BigInteger serialNumber)
throws org.apache.ws.security.WSSecurityException
getAliasForX509Cert in interface org.apache.ws.security.components.crypto.Cryptoissuer - The issuer's name for the certificateserialNumber - The serial number of the certificate from the named issuer
org.apache.ws.security.WSSecurityException
public String getAliasForX509Cert(byte[] skiBytes)
throws org.apache.ws.security.WSSecurityException
getAliasForX509Cert in interface org.apache.ws.security.components.crypto.CryptoskiBytes - The SKI info bytes
org.apache.ws.security.WSSecurityExceptionpublic String getDefaultX509Alias()
getDefaultX509Alias in interface org.apache.ws.security.components.crypto.Cryptopublic String getAliasKrbKey()
getAliasKrbKey in interface org.apache.ws.security.components.crypto.Cryptopublic String getPasswordKrbKey()
getPasswordKrbKey in interface org.apache.ws.security.components.crypto.Crypto
public byte[] getSKIBytesFromCert(X509Certificate cert)
throws org.apache.ws.security.WSSecurityException
getSKIBytesFromCert in interface org.apache.ws.security.components.crypto.Cryptocert - The certificate to read SKI
org.apache.ws.security.WSSecurityException
public String getAliasForX509CertThumb(byte[] thumb)
throws org.apache.ws.security.WSSecurityException
getAliasForX509CertThumb in interface org.apache.ws.security.components.crypto.Cryptothumb - The SHA1 thumbprint info bytes
org.apache.ws.security.WSSecurityException - if problems during keystore handling or wrong certificatepublic KeyStore getKeyStore()
getKeyStore in interface org.apache.ws.security.components.crypto.Crypto
public CertificateFactory getCertificateFactory()
throws org.apache.ws.security.WSSecurityException
getCertificateFactory in interface org.apache.ws.security.components.crypto.Cryptoorg.apache.ws.security.WSSecurityException
public String[] getAliasesForDN(String subjectDN)
throws org.apache.ws.security.WSSecurityException
getAliasesForDN in interface org.apache.ws.security.components.crypto.CryptosubjectDN - The DN of subject to look for in the keystore
org.apache.ws.security.WSSecurityException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||