org.n52.security.common.crypto
Class AliasMappingKeyProviderDecorator

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

public class AliasMappingKeyProviderDecorator
extends AbstractKeyPairProviderDecorator

Wraps incomming alias names to alias names used in the decorated provider. If the name can't be mapped the incomming name is given to the decorated provider.

Author:
Marko Reiprecht

Constructor Summary
AliasMappingKeyProviderDecorator()
           
AliasMappingKeyProviderDecorator(KeyPairProvider delegate)
           
 
Method Summary
 Map<String,String> getAliasToKeyAliasMap()
           
 KeyPair resolveByAlias(String alias, char[] password)
          Resolves a keypair by an alias.
 void setAliasToKeyAliasMap(Map<String,String> aliasToKeyAliasMap)
          It is espected that the incoming alias names are used as keys and the internal/outcomming alias names are used as values.
 
Methods inherited from class org.n52.security.common.crypto.AbstractKeyPairProviderDecorator
getDelegate, resolveByCertificate, resolveBySerialIssuer, setDelegate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AliasMappingKeyProviderDecorator

public AliasMappingKeyProviderDecorator()

AliasMappingKeyProviderDecorator

public AliasMappingKeyProviderDecorator(KeyPairProvider delegate)
Method Detail

getAliasToKeyAliasMap

public Map<String,String> getAliasToKeyAliasMap()
Returns:
the aliasToKeyAliasMap

setAliasToKeyAliasMap

public void setAliasToKeyAliasMap(Map<String,String> aliasToKeyAliasMap)
It is espected that the incoming alias names are used as keys and the internal/outcomming alias names are used as values.

Parameters:
aliasToKeyAliasMap - the aliasToKeyAliasMap to set

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
Overrides:
resolveByAlias in class AbstractKeyPairProviderDecorator
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[])


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