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 java.lang.Object
- implements org.apache.ws.security.components.crypto.Crypto
|
Field Summary |
private static java.lang.String |
ALIAS
|
private static java.lang.String[] |
ALIASES
|
private java.security.cert.CertificateFactory |
certFact
|
private static ContextCrypto |
crypto
|
private static org.globus.util.I18n |
i18n
|
private static org.apache.commons.logging.Log |
log
|
private java.util.Properties |
properties
|
(package private) static java.lang.String |
SKI_OID
|
| 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 java.lang.String ALIAS
- See Also:
- Constant Field Values
ALIASES
private static final java.lang.String[] ALIASES
properties
private java.util.Properties properties
certFact
private java.security.cert.CertificateFactory certFact
crypto
private static ContextCrypto crypto
SKI_OID
static java.lang.String SKI_OID
ContextCrypto
public ContextCrypto()
ContextCrypto
public ContextCrypto(java.util.Properties properties)
getInstance
public static ContextCrypto getInstance()
getPrivateKey
public java.security.PrivateKey getPrivateKey(java.lang.String alias,
java.lang.String password)
throws java.lang.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:
java.lang.Exception
loadCertificate
public java.security.cert.X509Certificate loadCertificate(java.io.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 java.security.cert.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 java.lang.String getAliasForX509Cert(java.lang.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 java.lang.String getAliasForX509Cert(java.lang.String issuer,
java.math.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 java.lang.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 java.lang.String getAliasForX509Cert(java.security.cert.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 java.lang.String getDefaultX509Alias()
- Specified by:
getDefaultX509Alias in interface org.apache.ws.security.components.crypto.Crypto
getCertificates
public java.security.cert.X509Certificate[] getCertificates(java.lang.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(java.security.KeyStore ks)
load
public void load(java.io.InputStream input)
throws org.apache.ws.security.components.crypto.CredentialException
- Throws:
org.apache.ws.security.components.crypto.CredentialException
getKeyStore
public java.security.KeyStore getKeyStore()
- Specified by:
getKeyStore in interface org.apache.ws.security.components.crypto.Crypto
getAliasesForDN
public java.lang.String[] getAliasesForDN(java.lang.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,
java.security.cert.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(java.security.cert.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 java.security.cert.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(java.security.cert.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