org.opensaml.xml.security.x509
Class X509KeyManagerX509CredentialAdapter

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.X509KeyManagerX509CredentialAdapter
All Implemented Interfaces:
Credential, X509Credential

public class X509KeyManagerX509CredentialAdapter
extends BasicCredential
implements X509Credential

A class that wraps a X509KeyManager and exposes it as an X509Credential.


Field Summary
private  String credentialAlias
          Alias used to reference the credential in the key manager.
private  X509KeyManager keyManager
          Wrapped key manager.
 
Fields inherited from class org.opensaml.xml.security.credential.AbstractCredential
credentialContextSet, entityID, keyNames, privateKey, publicKey, secretKey, usageType
 
Constructor Summary
X509KeyManagerX509CredentialAdapter(X509KeyManager manager, String alias)
          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

credentialAlias

private String credentialAlias
Alias used to reference the credential in the key manager.


keyManager

private X509KeyManager keyManager
Wrapped key manager.

Constructor Detail

X509KeyManagerX509CredentialAdapter

public X509KeyManagerX509CredentialAdapter(X509KeyManager manager,
                                           String alias)
Constructor.

Parameters:
manager - wrapped key manager
alias - alias used to reference the credential in the key manager
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-2013. All Rights Reserved.