org.n52.security.common.crypto
Class AbstractKeyPairProviderDecorator

java.lang.Object
  extended by org.n52.security.common.crypto.AbstractKeyPairProviderDecorator
All Implemented Interfaces:
KeyPairProvider
Direct Known Subclasses:
AliasMappingKeyProviderDecorator

public abstract class AbstractKeyPairProviderDecorator
extends Object
implements KeyPairProvider

Simple base class for decorator implementations of KeyPairProviders.

Author:
Marko Reiprecht

Constructor Summary
AbstractKeyPairProviderDecorator()
           
AbstractKeyPairProviderDecorator(KeyPairProvider delegate)
           
 
Method Summary
 KeyPairProvider getDelegate()
           
 KeyPair resolveByAlias(String alias, char[] password)
          Resolves a keypair by an alias.
 KeyPair resolveByCertificate(Certificate cert, char[] password)
          Resolves a key pair by a given certificate.
 KeyPair resolveBySerialIssuer(String issuerDN, BigInteger serial, char[] password)
          Resolves a key pair by a SerialIssuer, this is required to resolve certificates and it's private keys by the id of the certificate.
 void setDelegate(KeyPairProvider delegate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractKeyPairProviderDecorator

public AbstractKeyPairProviderDecorator()

AbstractKeyPairProviderDecorator

public AbstractKeyPairProviderDecorator(KeyPairProvider delegate)
Method Detail

getDelegate

public KeyPairProvider getDelegate()

setDelegate

public void setDelegate(KeyPairProvider delegate)

resolveByAlias

public KeyPair resolveByAlias(String alias,
                              char[] password)
                       throws KeyPairResolvingException
Description copied from interface: KeyPairProvider
Resolves a keypair by an alias. The provider tries to resolve the private key and its public key or certificate. Only if none of the elements can be resolved an exception is thrown.

Specified by:
resolveByAlias in interface KeyPairProvider
Parameters:
alias - the alias.
password - a password for the private key, can be null.
Returns:
KeyPair.
Throws:
KeyPairResolvingException - if keypair can't be resolved.
See Also:
KeyPairProvider.resolveByAlias(java.lang.String, char[])

resolveByCertificate

public KeyPair resolveByCertificate(Certificate cert,
                                    char[] password)
                             throws KeyPairResolvingException
Description copied from interface: KeyPairProvider
Resolves a key pair by a given certificate. Only if none of the elements can be resolved an exception is thrown.

Specified by:
resolveByCertificate in interface KeyPairProvider
Parameters:
cert - the cert.
password - a password for the private key, can be null.
Returns:
KeyPair.
Throws:
KeyPairResolvingException - if error occurs.
See Also:
KeyPairProvider.resolveByCertificate(java.security.cert.Certificate, char[])

resolveBySerialIssuer

public KeyPair resolveBySerialIssuer(String issuerDN,
                                     BigInteger serial,
                                     char[] password)
                              throws KeyPairResolvingException
Description copied from interface: KeyPairProvider
Resolves a key pair by a SerialIssuer, this is required to resolve certificates and it's private keys by the id of the certificate. Only if none of the elements can be resolved an exception is thrown.

Specified by:
resolveBySerialIssuer in interface KeyPairProvider
Parameters:
issuerDN - the issuerDN.
serial - the serial.
password - a password for the private key, can be null.
Returns:
KeyPair.
Throws:
KeyPairResolvingException - if error occurs.
See Also:
KeyPairProvider.resolveBySerialIssuer(java.lang.String, java.math.BigInteger, char[])


Copyright © 2004–2013 52north.org. All rights reserved.