org.globus.wsrf.impl.security.authentication
Class ContextCrypto
java.lang.Object
org.globus.wsrf.impl.security.authentication.ContextCrypto
- All Implemented Interfaces:
- org.apache.ws.security.components.crypto.Crypto
- public class ContextCrypto
- extends Object
- implements org.apache.ws.security.components.crypto.Crypto
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
i18n
private static org.globus.util.I18n i18n
log
private static org.apache.commons.logging.Log log
ALIAS
private static final String ALIAS
- See Also:
- Constant Field Values
ALIASES
private static final String[] ALIASES
properties
private Properties properties
certFact
private CertificateFactory certFact
crypto
private static ContextCrypto crypto
SKI_OID
static String SKI_OID
ContextCrypto
public ContextCrypto()
ContextCrypto
public ContextCrypto(Properties properties)
getInstance
public static ContextCrypto getInstance()
getPrivateKey
public PrivateKey getPrivateKey(String alias,
String password)
throws Exception
- Gets the private key from the current thread context.
- Specified by:
getPrivateKey in interface org.apache.ws.security.components.crypto.Crypto
- Parameters:
alias - ignoredpassword - ignored
- Returns:
- The private key
- Throws:
Exception
loadCertificate
public X509Certificate loadCertificate(InputStream in)
throws org.apache.ws.security.WSSecurityException
- Specified by:
loadCertificate in interface org.apache.ws.security.components.crypto.Crypto
- Throws:
org.apache.ws.security.WSSecurityException
getX509Certificates
public X509Certificate[] getX509Certificates(byte[] data,
boolean reverse)
throws org.apache.ws.security.WSSecurityException
- Specified by:
getX509Certificates in interface org.apache.ws.security.components.crypto.Crypto
- Throws:
org.apache.ws.security.WSSecurityException
getAliasForX509Cert
public String getAliasForX509Cert(String issuer)
throws org.apache.ws.security.WSSecurityException
- Specified by:
getAliasForX509Cert in interface org.apache.ws.security.components.crypto.Crypto
- Throws:
org.apache.ws.security.WSSecurityException
getAliasForX509Cert
public String getAliasForX509Cert(String issuer,
BigInteger serialNumber)
throws org.apache.ws.security.WSSecurityException
- Specified by:
getAliasForX509Cert in interface org.apache.ws.security.components.crypto.Crypto
- Throws:
org.apache.ws.security.WSSecurityException
getAliasForX509Cert
public String getAliasForX509Cert(byte[] skiBytes)
throws org.apache.ws.security.WSSecurityException
- Specified by:
getAliasForX509Cert in interface org.apache.ws.security.components.crypto.Crypto
- Throws:
org.apache.ws.security.WSSecurityException
getAliasForX509Cert
public String getAliasForX509Cert(Certificate cert)
throws org.apache.ws.security.WSSecurityException
- Specified by:
getAliasForX509Cert in interface org.apache.ws.security.components.crypto.Crypto
- Throws:
org.apache.ws.security.WSSecurityException
getDefaultX509Alias
public String getDefaultX509Alias()
- Specified by:
getDefaultX509Alias in interface org.apache.ws.security.components.crypto.Crypto
getCertificates
public X509Certificate[] getCertificates(String alias)
throws org.apache.ws.security.WSSecurityException
- Gets the list of certificates for a given alias.
- Specified by:
getCertificates in interface org.apache.ws.security.components.crypto.Crypto
- Parameters:
alias - Lookup certificate chain for this alias
- Returns:
- Array of X509 certificates for this alias name, or
null if this alias does not exist in the keystore
- Throws:
org.apache.ws.security.WSSecurityException
setKeyStore
public void setKeyStore(KeyStore ks)
load
public void load(InputStream input)
throws org.apache.ws.security.components.crypto.CredentialException
- Throws:
org.apache.ws.security.components.crypto.CredentialException
getKeyStore
public KeyStore getKeyStore()
- Specified by:
getKeyStore in interface org.apache.ws.security.components.crypto.Crypto
getAliasesForDN
public String[] getAliasesForDN(String subjectDN)
throws org.apache.ws.security.WSSecurityException
- Specified by:
getAliasesForDN in interface org.apache.ws.security.components.crypto.Crypto
- Throws:
org.apache.ws.security.WSSecurityException
getCertificateData
public byte[] getCertificateData(boolean reverse,
X509Certificate[] certs)
throws org.apache.ws.security.WSSecurityException
- Specified by:
getCertificateData in interface org.apache.ws.security.components.crypto.Crypto
- Throws:
org.apache.ws.security.WSSecurityException
getSKIBytesFromCert
public byte[] getSKIBytesFromCert(X509Certificate cert)
throws org.apache.ws.security.WSSecurityException
- Reads the SubjectKeyIdentifier information from the certificate.
- Specified by:
getSKIBytesFromCert in interface org.apache.ws.security.components.crypto.Crypto
- Parameters:
cert - The certificate to read SKI
- Returns:
- The byte array conating the binary SKI data
- Throws:
org.apache.ws.security.WSSecurityException
getCertificateFactory
public CertificateFactory getCertificateFactory()
throws org.apache.ws.security.WSSecurityException
- Specified by:
getCertificateFactory in interface org.apache.ws.security.components.crypto.Crypto
- Throws:
org.apache.ws.security.WSSecurityException
validateCertPath
public boolean validateCertPath(X509Certificate[] certs)
throws org.apache.ws.security.WSSecurityException
- Specified by:
validateCertPath in interface org.apache.ws.security.components.crypto.Crypto
- Throws:
org.apache.ws.security.WSSecurityException