@UriParams public class XmlSignerConfiguration extends XmlSignatureConfiguration
Constructor and Description |
---|
XmlSignerConfiguration() |
Modifier and Type | Method and Description |
---|---|
XmlSignerConfiguration |
copy() |
Boolean |
getAddKeyInfoReference() |
AlgorithmMethod |
getCanonicalizationMethod() |
String |
getContentObjectId() |
String |
getContentReferenceType() |
String |
getContentReferenceUri() |
String |
getDigestAlgorithm() |
KeyAccessor |
getKeyAccessor() |
String |
getParentLocalName() |
String |
getParentNamespace() |
XPathFilterParameterSpec |
getParentXpath() |
Boolean |
getPlainText() |
String |
getPlainTextEncoding() |
String |
getPrefixForXmlSignatureNamespace() |
XmlSignatureProperties |
getProperties() |
String |
getSignatureAlgorithm() |
String |
getSignatureId() |
List<AlgorithmMethod> |
getTransformMethods() |
List<XPathFilterParameterSpec> |
getXpathsToIdAttributes() |
void |
setAddKeyInfoReference(Boolean addKeyInfoReference)
In order to protect the KeyInfo element from tampering you can add a reference to the signed info element so that
it is protected via the signature value.
|
void |
setCanonicalizationMethod(AlgorithmMethod canonicalizationMethod)
Canonicalization method used to canonicalize the SignedInfo element before the digest is calculated.
|
void |
setContentObjectId(String contentObjectId)
Sets the content object Id attribute value.
|
void |
setContentReferenceType(String referenceType)
Type of the content reference.
|
void |
setContentReferenceUri(String referenceUri)
Reference URI for the content to be signed.
|
void |
setDigestAlgorithm(String digestAlgorithm)
Digest algorithm URI.
|
void |
setKeyAccessor(KeyAccessor keyAccessor)
For the signing process, a private key is necessary.
|
void |
setParentLocalName(String parentLocalName)
Local name of the parent element to which the XML signature element will be added.
|
void |
setParentNamespace(String parentNamespace)
Namespace of the parent element to which the XML signature element will be added.
|
void |
setParentXpath(XPathFilterParameterSpec parentXpath)
Sets the XPath to find the parent node in the enveloped case.
|
void |
setPlainText(Boolean plainText)
Indicator whether the message body contains plain text.
|
void |
setPlainTextEncoding(String plainTextEncoding)
Encoding of the plain text.
|
void |
setPrefixForXmlSignatureNamespace(String prefixForXmlSignatureNamespace)
Namespace prefix for the XML signature namespace "http://www.w3.org/2000/09/xmldsig#".
|
void |
setProperties(XmlSignatureProperties properties)
For adding additional References and Objects to the XML signature which contain additional properties, you can
provide a bean which implements the XmlSignatureProperties interface.
|
void |
setSignatureAlgorithm(String signatureAlgorithm)
Signature algorithm.
|
void |
setSignatureId(String signatureId)
Sets the signature Id.
|
void |
setTransformMethods(List<AlgorithmMethod> transformMethods)
Transforms which are executed on the message body before the digest is calculated.
|
void |
setXpathsToIdAttributes(List<XPathFilterParameterSpec> xpathsToIdAttributes)
Define the elements which are signed in the detached case via XPATH expressions to ID attributes (attributes of
type ID).
|
getBaseUri, getClearHeaders, getCryptoContextProperties, getDisallowDoctypeDecl, getOmitXmlDeclaration, getOutputXmlEncoding, getSchemaResourceUri, getUriDereferencer, setBaseUri, setClearHeaders, setCryptoContextProperties, setDisallowDoctypeDecl, setOmitXmlDeclaration, setOutputXmlEncoding, setSchemaResourceUri, setUriDereferencer
public XmlSignerConfiguration copy()
public KeyAccessor getKeyAccessor()
public void setKeyAccessor(KeyAccessor keyAccessor)
public AlgorithmMethod getCanonicalizationMethod()
public void setCanonicalizationMethod(AlgorithmMethod canonicalizationMethod)
public List<AlgorithmMethod> getTransformMethods()
public void setTransformMethods(List<AlgorithmMethod> transformMethods)
public String getSignatureAlgorithm()
public void setSignatureAlgorithm(String signatureAlgorithm)
public String getDigestAlgorithm()
public void setDigestAlgorithm(String digestAlgorithm)
public Boolean getAddKeyInfoReference()
public void setAddKeyInfoReference(Boolean addKeyInfoReference)
Only relevant when a KeyInfo is returned by KeyAccessor
. and KeyInfo.getId()
is not
null
.
public String getPrefixForXmlSignatureNamespace()
public void setPrefixForXmlSignatureNamespace(String prefixForXmlSignatureNamespace)
null
or an empty value is set then no prefix is used for the XML signature namespace.
See best practice http://www.w3.org/TR/xmldsig-bestpractices/#signing-xml- without-namespaces
prefixForXmlSignatureNamespace
- prefixpublic String getParentLocalName()
public void setParentLocalName(String parentLocalName)
setParentXpath(XPathFilterParameterSpec)
.
Default value is null
. The value must be null
for enveloping and detached XML
signature.
This parameter or the parameter setParentXpath(XPathFilterParameterSpec)
for enveloped signature and the
parameter setXpathsToIdAttributes(List)
for detached signature must not be set in the same
configuration.
If the parameters parentXpath and parentLocalName are specified in the same configuration then an exception is thrown.
parentLocalName
- local namepublic String getParentNamespace()
public void setParentNamespace(String parentNamespace)
public String getContentObjectId()
public void setContentObjectId(String contentObjectId)
null
value, then a new UUID will be generated. Only used in the enveloping case.public String getSignatureId()
public void setSignatureId(String signatureId)
public String getContentReferenceUri()
public void setContentReferenceUri(String referenceUri)
XmlSignatureConfiguration.setSchemaResourceUri(String)
) must also be set because
the schema validator will then find out which attributes are ID attributes. Will be ignored in the enveloping or
detached case.public String getContentReferenceType()
public void setContentReferenceType(String referenceType)
null
. This value can be overwritten by the
header XmlSignatureConstants.HEADER_CONTENT_REFERENCE_TYPE
.public Boolean getPlainText()
public void setPlainText(Boolean plainText)
false
, indicating that
the message body contains XML. The value can be overwritten by the header
XmlSignatureConstants.HEADER_MESSAGE_IS_PLAIN_TEXT
.public String getPlainTextEncoding()
public void setPlainTextEncoding(String plainTextEncoding)
plainText
.
Default value is "UTF-8".public XmlSignatureProperties getProperties()
public void setProperties(XmlSignatureProperties properties)
public List<XPathFilterParameterSpec> getXpathsToIdAttributes()
public void setXpathsToIdAttributes(List<XPathFilterParameterSpec> xpathsToIdAttributes)
You can also set the XPATH list dynamically via the header
XmlSignatureConstants.HEADER_XPATHS_TO_ID_ATTRIBUTES
.
The parameter setParentLocalName(String)
or setParentXpath(XPathFilterParameterSpec)
for
enveloped signature and this parameter for detached signature must not be set in the same configuration.
public XPathFilterParameterSpec getParentXpath()
public void setParentXpath(XPathFilterParameterSpec parentXpath)
setParentLocalName(String)
and
setParentNamespace(String)
.
Default value is null
. The value must be null
for enveloping and detached XML
signature.
If the parameters parentXpath and parentLocalName are specified in the same configuration then an exception is thrown.
parentXpath
- xpath to the parent node, if the xpath returns several values then the first Element node is
usedApache Camel