org.n52.security.common.crypto
Interface KeyPairProvider

All Known Implementing Classes:
AbstractKeyPairProviderDecorator, AliasMappingKeyProviderDecorator, FilesystemKeyPairProvider, KeystoreKeyPairProvider

public interface KeyPairProvider

Resolves cryptographic keys.

Version:
$Revision: $
Author:
Marko Reiprecht Created on 18.07.2008

Method Summary
 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.
 

Method Detail

resolveByAlias

KeyPair resolveByAlias(String alias,
                       char[] password)
                       throws KeyPairResolvingException
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.

Parameters:
alias - the alias.
password - a password for the private key, can be null.
Returns:
KeyPair.
Throws:
KeyPairResolvingException - if keypair can't be resolved.

resolveBySerialIssuer

KeyPair resolveBySerialIssuer(String issuerDN,
                              BigInteger serial,
                              char[] password)
                              throws KeyPairResolvingException
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.

Parameters:
issuerDN - the issuerDN.
serial - the serial.
password - a password for the private key, can be null.
Returns:
KeyPair.
Throws:
KeyPairResolvingException - if error occurs.

resolveByCertificate

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

Parameters:
cert - the cert.
password - a password for the private key, can be null.
Returns:
KeyPair.
Throws:
KeyPairResolvingException - if error occurs.


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