Class ProxyCertificateImpl
java.lang.Object
eu.emi.security.authn.x509.helpers.proxy.ProxyCertificateImpl
- All Implemented Interfaces:
ProxyCertificate
Default implementation of the
ProxyCertificate
interface.- Author:
- K. Benedyczak
-
Constructor Summary
ConstructorsConstructorDescriptionProxyCertificateImpl
(X509Certificate[] chain) ProxyCertificateImpl
(X509Certificate[] chain, PrivateKey privateKey) -
Method Summary
Modifier and TypeMethodDescriptionReturns the certificate chain of the proxy.Returns the X509Credential wrapping the generated private key and proxy certificate.Returns the generated private key of this proxy.boolean
-
Constructor Details
-
ProxyCertificateImpl
public ProxyCertificateImpl(X509Certificate[] chain, PrivateKey privateKey) throws KeyStoreException - Throws:
KeyStoreException
-
ProxyCertificateImpl
-
-
Method Details
-
getCertificateChain
Description copied from interface:ProxyCertificate
Returns the certificate chain of the proxy.- Specified by:
getCertificateChain
in interfaceProxyCertificate
- Returns:
- the Certificate chain starting with the generated proxy certificate.
-
getPrivateKey
Description copied from interface:ProxyCertificate
Returns the generated private key of this proxy. If public key was manually set an exception is thrown.- Specified by:
getPrivateKey
in interfaceProxyCertificate
- Returns:
- The private key.
- Throws:
IllegalStateException
- if the private and public keys were not generated
-
getCredential
Description copied from interface:ProxyCertificate
Returns the X509Credential wrapping the generated private key and proxy certificate. This method is useful if KeyStore or KeyManager with the newly generated proxy certificate is needed.- Specified by:
getCredential
in interfaceProxyCertificate
- Returns:
- The generated credential wrapped in
X509Credential
- Throws:
IllegalStateException
- if the private and public keys were not generated
-
hasPrivateKey
public boolean hasPrivateKey()- Specified by:
hasPrivateKey
in interfaceProxyCertificate
- Returns:
- true if private key was generated and is available through
ProxyCertificate.getPrivateKey()
andProxyCertificate.getCredential()
-