Class AbstractX509Credential
java.lang.Object
eu.emi.security.authn.x509.helpers.AbstractX509Credential
- All Implemented Interfaces:
X509Credential
- Direct Known Subclasses:
KeyAndCertCredential
,KeystoreCredential
Base class with a shared code for
X509Credential
implementations.- Author:
- K. Benedyczak
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionHelper method to get certificate from the underlying keystoreHelper method to get certificate chain from the underlying keystoregetKey()
Helper method to get private key from the underlying keystoreReturns an alias which can be used to obtain the PrivateKey entry from the KeyStore returned by theX509Credential.getKeyStore()
method.Returns a KeyManager which accompanies the KeyStore.char[]
Returns a password which can be used to obtain PrivateKey entry from the KeyStore returned by theX509Credential.getKeyStore()
method, with the alias returned by theX509Credential.getKeyAlias()
method.Returns the credential in a keystore.
-
Field Details
-
ALIAS
- See Also:
-
KEY_PASSWD
public static final char[] KEY_PASSWD -
ks
-
-
Constructor Details
-
AbstractX509Credential
public AbstractX509Credential()
-
-
Method Details
-
getKeyStore
Returns the credential in a keystore.- Specified by:
getKeyStore
in interfaceX509Credential
- Returns:
- the KeyStore
-
getKeyManager
Returns a KeyManager which accompanies the KeyStore.- Specified by:
getKeyManager
in interfaceX509Credential
- Returns:
- the KeyManager
-
getKeyPassword
public char[] getKeyPassword()Returns a password which can be used to obtain PrivateKey entry from the KeyStore returned by theX509Credential.getKeyStore()
method, with the alias returned by theX509Credential.getKeyAlias()
method.- Specified by:
getKeyPassword
in interfaceX509Credential
- Returns:
- key password
-
getKeyAlias
Returns an alias which can be used to obtain the PrivateKey entry from the KeyStore returned by theX509Credential.getKeyStore()
method.- Specified by:
getKeyAlias
in interfaceX509Credential
- Returns:
- key alias
-
getKey
Helper method to get private key from the underlying keystore- Specified by:
getKey
in interfaceX509Credential
- Returns:
- private key
-
getCertificate
Helper method to get certificate from the underlying keystore- Specified by:
getCertificate
in interfaceX509Credential
- Returns:
- certificate
-
getCertificateChain
Helper method to get certificate chain from the underlying keystore- Specified by:
getCertificateChain
in interfaceX509Credential
- Returns:
- certificate chain
-
getSubjectName
- Specified by:
getSubjectName
in interfaceX509Credential
- Returns:
- RFC 2253 distinguished name of the certificate subject
-