org.opensaml.xml.security.x509
Class KeyStoreX509CredentialAdapter

java.lang.Object
  extended by org.opensaml.xml.security.credential.AbstractCredential
      extended by org.opensaml.xml.security.credential.BasicCredential
          extended by org.opensaml.xml.security.x509.KeyStoreX509CredentialAdapter
All Implemented Interfaces:
Credential, X509Credential

public class KeyStoreX509CredentialAdapter
extends BasicCredential
implements X509Credential

A wrapper that changes a KeyStore in to a X509Credential.


Field Summary
 
Fields inherited from class org.opensaml.xml.security.credential.AbstractCredential
credentialContextSet, entityID, keyNames, privateKey, publicKey, secretKey, usageType
 
Constructor Summary
KeyStoreX509CredentialAdapter(java.security.KeyStore store, java.lang.String alias, char[] password)
          Constructor.
 
Method Summary
 java.util.Collection<java.security.cert.X509CRL> getCRLs()
          Gets a collection of CRLs associated with the credential.
 java.security.cert.X509Certificate getEntityCertificate()
          Gets the public certificate for the entity.
 java.util.Collection<java.security.cert.X509Certificate> getEntityCertificateChain()
          Gets an immutable collection of certificates in the entity's trust chain.
 java.security.PrivateKey getPrivateKey()
          Gets the private key for the entity if there is one.
 java.security.PublicKey getPublicKey()
          Gets the public key for the entity.
 
Methods inherited from class org.opensaml.xml.security.credential.BasicCredential
getCredentialType, setEntityId, setPrivateKey, setPublicKey, setSecretKey, setUsageType
 
Methods inherited from class org.opensaml.xml.security.credential.AbstractCredential
getCredentalContextSet, getEntityId, getKeyNames, getSecretKey, getUsageType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensaml.xml.security.credential.Credential
getCredentalContextSet, getCredentialType, getEntityId, getKeyNames, getSecretKey, getUsageType
 

Constructor Detail

KeyStoreX509CredentialAdapter

public KeyStoreX509CredentialAdapter(java.security.KeyStore store,
                                     java.lang.String alias,
                                     char[] password)
Constructor.

Parameters:
store - store containing key to be exposed
alias - alias to the credential to be exposed
password - password to the key to be exposed
Method Detail

getCRLs

public java.util.Collection<java.security.cert.X509CRL> getCRLs()
Gets a collection of CRLs associated with the credential.

Specified by:
getCRLs in interface X509Credential
Returns:
CRLs associated with the credential

getEntityCertificate

public java.security.cert.X509Certificate getEntityCertificate()
Gets the public certificate for the entity. The public key of this certificate will be the same key obtained from Credential.getPublicKey().

Specified by:
getEntityCertificate in interface X509Credential
Returns:
the public certificate for the entity

getEntityCertificateChain

public java.util.Collection<java.security.cert.X509Certificate> getEntityCertificateChain()
Gets an immutable collection of certificates in the entity's trust chain. The entity certificate is contained within this list. No specific ordering of the certificates is guaranteed.

Specified by:
getEntityCertificateChain in interface X509Credential
Returns:
entities certificate chain

getPrivateKey

public java.security.PrivateKey getPrivateKey()
Gets the private key for the entity if there is one.

Specified by:
getPrivateKey in interface Credential
Overrides:
getPrivateKey in class AbstractCredential
Returns:
the private key for the entity

getPublicKey

public java.security.PublicKey getPublicKey()
Gets the public key for the entity.

Specified by:
getPublicKey in interface Credential
Overrides:
getPublicKey in class AbstractCredential
Returns:
public key for the entity


Copyright © 2006-2012 Internet2. All Rights Reserved.