public class DefaultKeyAccessor extends DefaultKeySelector implements KeyAccessor
KeySelector.Purpose
Constructor and Description |
---|
DefaultKeyAccessor() |
Modifier and Type | Method and Description |
---|---|
KeyInfo |
getKeyInfo(org.apache.camel.Message message,
Node messageBody,
KeyInfoFactory factory)
Returns the optional key info to be incorporated into the XML signature.
|
KeySelector |
getKeySelector(org.apache.camel.Message message)
Returns the key selector which determines the key for signing the XML
document.
|
String |
getProvider() |
void |
setProvider(String provider) |
getCamelContext, select, setAlias, setCamelContext, setKeyStore, setKeyStoreParameters, setPassword, setPassword
singletonKeySelector
public String getProvider()
public void setProvider(String provider)
public KeySelector getKeySelector(org.apache.camel.Message message) throws Exception
KeyAccessor
null
is returned the XML signature generator will throw a
XmlSignatureNoKeyException
.getKeySelector
in interface KeyAccessor
message
- the incoming message, from which you can read headers to
configure the key selector, for example, a header could
contain a private key for the key selectornull
Exception
- if an error occurspublic KeyInfo getKeyInfo(org.apache.camel.Message message, Node messageBody, KeyInfoFactory factory) throws Exception
KeyAccessor
null
is returned, no key info element is created. You can
create a key info instance via the key info factory.
This method will be called several times if several signatures shall be created for the XML document; for each signature a call is executed. This allows you to create different key info IDs.
getKeyInfo
in interface KeyAccessor
message
- incoming message, from which you can read headers, for
example, there could be a header which contains the public key
or certificate for the key infomessageBody
- the message body as DOM node. If the message body is plain
text then the node will be a text node. If the message body is
a XML document, then the node is the root element.factory
- key info factory for creating the KeyInfo instancenull
Exception
- if an error occursApache Camel