org.n52.security.common.crypto
Interface KeyPairProvider

All Known Implementing Classes:
KeystoreKeyPairProvider

public interface KeyPairProvider

Interface KeyPairProvider encapsulates typical resolving methods of cryptographic keys.

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

Method Summary
 KeyPair resolveByAlias(java.lang.String alias, char[] password)
          Method resolves a keypair by an alias.
 KeyPair resolveByCertificate(java.security.cert.Certificate cert, char[] password)
          Method resolves a key pair by a given certificate.
 KeyPair resolveBySerialIssuer(java.lang.String issuerDN, java.math.BigInteger serial, char[] password)
          Method 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(java.lang.String alias,
                       char[] password)
                       throws KeyPairResolvingException
Method 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(java.lang.String issuerDN,
                              java.math.BigInteger serial,
                              char[] password)
                              throws KeyPairResolvingException
Method 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(java.security.cert.Certificate cert,
                             char[] password)
                             throws KeyPairResolvingException
Method 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-2009 52north.org. All Rights Reserved.