org.apache.xml.security.keys.keyresolver.implementations
Class SingleKeyResolver

java.lang.Object
  extended by org.apache.xml.security.keys.keyresolver.KeyResolverSpi
      extended by org.apache.xml.security.keys.keyresolver.implementations.SingleKeyResolver

public class SingleKeyResolver
extends KeyResolverSpi

Resolves a single Key based on the KeyName.


Field Summary
 
Fields inherited from class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
globalResolver, properties, secureValidation
 
Constructor Summary
SingleKeyResolver(String keyName, PrivateKey privateKey)
          Constructor.
SingleKeyResolver(String keyName, PublicKey publicKey)
          Constructor.
SingleKeyResolver(String keyName, SecretKey secretKey)
          Constructor.
 
Method Summary
 boolean engineCanResolve(Element element, String baseURI, StorageResolver storage)
          This method returns whether the KeyResolverSpi is able to perform the requested action.
 PrivateKey engineLookupAndResolvePrivateKey(Element element, String baseURI, StorageResolver storage)
          Method engineResolvePrivateKey
 PublicKey engineLookupAndResolvePublicKey(Element element, String baseURI, StorageResolver storage)
          Method engineLookupAndResolvePublicKey
 X509Certificate engineLookupResolveX509Certificate(Element element, String baseURI, StorageResolver storage)
          Method engineResolveX509Certificate
 SecretKey engineResolveSecretKey(Element element, String baseURI, StorageResolver storage)
          Method engineResolveSecretKey
 
Methods inherited from class org.apache.xml.security.keys.keyresolver.KeyResolverSpi
engineGetProperty, engineLookupAndResolveSecretKey, engineResolvePublicKey, engineResolveX509Certificate, engineSetProperty, setGlobalResolver, setSecureValidation, understandsProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleKeyResolver

public SingleKeyResolver(String keyName,
                         PublicKey publicKey)
Constructor.

Parameters:
keyName -
publicKey -

SingleKeyResolver

public SingleKeyResolver(String keyName,
                         PrivateKey privateKey)
Constructor.

Parameters:
keyName -
privateKey -

SingleKeyResolver

public SingleKeyResolver(String keyName,
                         SecretKey secretKey)
Constructor.

Parameters:
keyName -
secretKey -
Method Detail

engineCanResolve

public boolean engineCanResolve(Element element,
                                String baseURI,
                                StorageResolver storage)
This method returns whether the KeyResolverSpi is able to perform the requested action.

Overrides:
engineCanResolve in class KeyResolverSpi
Parameters:
element -
baseURI -
storage -
Returns:
whether the KeyResolverSpi is able to perform the requested action.

engineLookupAndResolvePublicKey

public PublicKey engineLookupAndResolvePublicKey(Element element,
                                                 String baseURI,
                                                 StorageResolver storage)
                                          throws KeyResolverException
Method engineLookupAndResolvePublicKey

Overrides:
engineLookupAndResolvePublicKey in class KeyResolverSpi
Parameters:
element -
baseURI -
storage -
Returns:
null if no PublicKey could be obtained
Throws:
KeyResolverException

engineLookupResolveX509Certificate

public X509Certificate engineLookupResolveX509Certificate(Element element,
                                                          String baseURI,
                                                          StorageResolver storage)
                                                   throws KeyResolverException
Method engineResolveX509Certificate

Overrides:
engineLookupResolveX509Certificate in class KeyResolverSpi
Parameters:
element -
baseURI -
storage -
Returns:
resolved X509Certificate key from the registered from the elements
Throws:
KeyResolverException

engineResolveSecretKey

public SecretKey engineResolveSecretKey(Element element,
                                        String baseURI,
                                        StorageResolver storage)
                                 throws KeyResolverException
Method engineResolveSecretKey

Overrides:
engineResolveSecretKey in class KeyResolverSpi
Parameters:
element -
baseURI -
storage -
Returns:
resolved SecretKey key or null if no SecretKey could be obtained
Throws:
KeyResolverException

engineLookupAndResolvePrivateKey

public PrivateKey engineLookupAndResolvePrivateKey(Element element,
                                                   String baseURI,
                                                   StorageResolver storage)
                                            throws KeyResolverException
Method engineResolvePrivateKey

Overrides:
engineLookupAndResolvePrivateKey in class KeyResolverSpi
Parameters:
element -
baseURI -
storage -
Returns:
resolved PrivateKey key or null if no PrivateKey could be obtained
Throws:
KeyResolverException


Copyright © 2000–2014 The Apache Software Foundation. All rights reserved.