eu.emi.security.authn.x509.helpers
Class AbstractX509Credential

java.lang.Object
  extended by eu.emi.security.authn.x509.helpers.AbstractX509Credential
All Implemented Interfaces:
X509Credential
Direct Known Subclasses:
KeyAndCertCredential, KeystoreCredential

public abstract class AbstractX509Credential
extends Object
implements X509Credential

Base class with a shared code for X509Credential implementations.

Author:
K. Benedyczak

Field Summary
static String ALIAS
           
static char[] KEY_PASSWD
           
protected  KeyStore ks
           
 
Constructor Summary
AbstractX509Credential()
           
 
Method Summary
 X509Certificate getCertificate()
          Helper method to get certificate from the underlying keystore
 X509Certificate[] getCertificateChain()
          Helper method to get certificate chain from the underlying keystore
 PrivateKey getKey()
          Helper method to get private key from the underlying keystore
 String getKeyAlias()
          Returns an alias which can be used to obtain the PrivateKey entry from the KeyStore returned by the X509Credential.getKeyStore() method.
 X509ExtendedKeyManager getKeyManager()
          Returns a KeyManager which accompanies the KeyStore.
 char[] getKeyPassword()
          Returns a password which can be used to obtain PrivateKey entry from the KeyStore returned by the X509Credential.getKeyStore() method, with the alias returned by the X509Credential.getKeyAlias() method.
 KeyStore getKeyStore()
          Returns the credential in a keystore.
 String getSubjectName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIAS

public static final String ALIAS
See Also:
Constant Field Values

KEY_PASSWD

public static final char[] KEY_PASSWD

ks

protected KeyStore ks
Constructor Detail

AbstractX509Credential

public AbstractX509Credential()
Method Detail

getKeyStore

public KeyStore getKeyStore()
Returns the credential in a keystore.

Specified by:
getKeyStore in interface X509Credential
Returns:
the KeyStore

getKeyManager

public X509ExtendedKeyManager getKeyManager()
Returns a KeyManager which accompanies the KeyStore.

Specified by:
getKeyManager in interface X509Credential
Returns:
the KeyManager

getKeyPassword

public char[] getKeyPassword()
Returns a password which can be used to obtain PrivateKey entry from the KeyStore returned by the X509Credential.getKeyStore() method, with the alias returned by the X509Credential.getKeyAlias() method.

Specified by:
getKeyPassword in interface X509Credential
Returns:
key password

getKeyAlias

public String getKeyAlias()
Returns an alias which can be used to obtain the PrivateKey entry from the KeyStore returned by the X509Credential.getKeyStore() method.

Specified by:
getKeyAlias in interface X509Credential
Returns:
key alias

getKey

public PrivateKey getKey()
Helper method to get private key from the underlying keystore

Specified by:
getKey in interface X509Credential

getCertificate

public X509Certificate getCertificate()
Helper method to get certificate from the underlying keystore

Specified by:
getCertificate in interface X509Credential

getCertificateChain

public X509Certificate[] getCertificateChain()
Helper method to get certificate chain from the underlying keystore

Specified by:
getCertificateChain in interface X509Credential

getSubjectName

public String getSubjectName()
Specified by:
getSubjectName in interface X509Credential
Returns:
RFC 2253 distinguished name of the certificate subject


Copyright © 2012-2013 European Middleware Initiative. All Rights Reserved.