eu.emi.security.authn.x509.helpers.proxy
Class ProxyCertificateImpl

java.lang.Object
  extended by eu.emi.security.authn.x509.helpers.proxy.ProxyCertificateImpl
All Implemented Interfaces:
ProxyCertificate

public class ProxyCertificateImpl
extends Object
implements ProxyCertificate

Default implementation of the ProxyCertificate interface.

Author:
K. Benedyczak

Constructor Summary
ProxyCertificateImpl(X509Certificate[] chain)
           
ProxyCertificateImpl(X509Certificate[] chain, PrivateKey privateKey)
           
 
Method Summary
 X509Certificate[] getCertificateChain()
          Returns the certificate chain of the proxy.
 X509Credential getCredential()
          Returns the X509Credential wrapping the generated private key and proxy certificate.
 PrivateKey getPrivateKey()
          Returns the generated private key of this proxy.
 boolean hasPrivateKey()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyCertificateImpl

public ProxyCertificateImpl(X509Certificate[] chain,
                            PrivateKey privateKey)
                     throws KeyStoreException
Throws:
KeyStoreException

ProxyCertificateImpl

public ProxyCertificateImpl(X509Certificate[] chain)
Method Detail

getCertificateChain

public X509Certificate[] getCertificateChain()
Description copied from interface: ProxyCertificate
Returns the certificate chain of the proxy.

Specified by:
getCertificateChain in interface ProxyCertificate
Returns:
the Certificate chain starting with the generated proxy certificate.

getPrivateKey

public PrivateKey getPrivateKey()
                         throws IllegalStateException
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 interface ProxyCertificate
Returns:
The private key.
Throws:
IllegalStateException - if the private and public keys were not generated

getCredential

public X509Credential getCredential()
                             throws IllegalStateException
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 interface ProxyCertificate
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 interface ProxyCertificate
Returns:
true if private key was generated and is available through ProxyCertificate.getPrivateKey() and ProxyCertificate.getCredential()


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