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
private  String credentialAlias
          Alias to the credential to be exposed.
private  char[] keyPassword
          Password for the key to be exposed.
private  KeyStore keyStore
          Keystore that contains the credential to be exposed.
private  Logger log
          Class logger.
 
Fields inherited from class org.opensaml.xml.security.credential.AbstractCredential
credentialContextSet, entityID, keyNames, privateKey, publicKey, secretKey, usageType
 
Constructor Summary
KeyStoreX509CredentialAdapter(KeyStore store, String alias, char[] password)
          Constructor.
 
Method Summary
 Collection<X509CRL> getCRLs()
          Gets a collection of CRLs associated with the credential.
 X509Certificate getEntityCertificate()
          Gets the public certificate for the entity.
 Collection<X509Certificate> getEntityCertificateChain()
          Gets an immutable collection of certificates in the entity's trust chain.
 PrivateKey getPrivateKey()
          Gets the private key for the entity if there is one.
 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
 

Field Detail

log

private Logger log
Class logger.


keyStore

private KeyStore keyStore
Keystore that contains the credential to be exposed.


credentialAlias

private String credentialAlias
Alias to the credential to be exposed.


keyPassword

private char[] keyPassword
Password for the key to be exposed.

Constructor Detail

KeyStoreX509CredentialAdapter

public KeyStoreX509CredentialAdapter(KeyStore store,
                                     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 Collection<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 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 Collection<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 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 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 © 1999-2012. All Rights Reserved.