eu.emi.security.authn.x509.impl
Class KeyAndCertCredential

java.lang.Object
  extended by eu.emi.security.authn.x509.helpers.AbstractX509Credential
      extended by eu.emi.security.authn.x509.impl.KeyAndCertCredential
All Implemented Interfaces:
X509Credential

public class KeyAndCertCredential
extends AbstractX509Credential

Wraps a PrivateKey and X509Certificate chain as a X509Credential.

This class is especially useful for quick, in-memory creation of KeyStore when key and certificate are already loaded.

Author:
K. Benedyczak

Field Summary
 
Fields inherited from class eu.emi.security.authn.x509.helpers.AbstractX509Credential
ALIAS, KEY_PASSWD, ks
 
Constructor Summary
KeyAndCertCredential(PrivateKey privateKey, X509Certificate[] certificateChain)
          Creates a new instance from the provided key and certificates.
 
Method Summary
 
Methods inherited from class eu.emi.security.authn.x509.helpers.AbstractX509Credential
getCertificate, getCertificateChain, getKey, getKeyAlias, getKeyManager, getKeyPassword, getKeyStore, getSubjectName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyAndCertCredential

public KeyAndCertCredential(PrivateKey privateKey,
                            X509Certificate[] certificateChain)
                     throws KeyStoreException
Creates a new instance from the provided key and certificates.

Parameters:
privateKey - private key to be placed in this X509Credential's KeyStore
certificateChain - certificates to be placed in this X509Credential's KeyStore. those certificates must match the provided privateKey. The user's certificate is assumed to be the first entry in the chain.
Throws:
KeyStoreException - if private key is invalid or doesn't match the certificate.


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