Package com.altova.raptorxml
Class HTTPXMLDsig
java.lang.Object
com.altova.raptorxml.HTTPXMLDsig
- All Implemented Interfaces:
XMLDsig
-
Constructor Summary
ConstructorsConstructorDescriptionHTTPXMLDsig
(com.altova.raptorxml.HTTPConnection connection, com.altova.raptorxml.AbstractRaptorXMLFactory parent) -
Method Summary
Modifier and TypeMethodDescriptionboolean
executeRemove
(String strResultOutputFileName) Execute the remove command.boolean
executeSign
(String strResultOutputFileName, String strSignatureType, String strSignatureCanonicalizationMethod) Execute the sign command.boolean
executeUpdate
(String strResultOutputFileName) Execute the update command.boolean
Execute the verify command.void
setAbsoluteReferenceUri
(boolean boAbsolute) Specifies whether the URI of the signed document is to be read as absolute (true) or relative (false).void
setAppendKeyInfo
(boolean boAppend) Append KeyInfo element to signature.void
setCertificateName
(String strCertName) The name of the certificate used for signing.void
setCertificateStore
(String strCertStore) Certificate store that contains the certificate used for signing.void
setDigestMethod
(String strDigestMethod) DigestMethod Algorithm used to compute the digest value over the input.void
setHMACOutputLength
(int length) Truncate the output of the HMAC algorithm to length.void
setHMACSecretKey
(String strSecretKey) Set the HMAC shared secret key; must have a minimum length of six characters.void
setInputFileName
(String filePath) Set the file name for the input XML data.void
setSignatureMethod
(String strSignatureMethod) Set the signature-method; Specifies the algorithm to use for generating the signatur.void
setTransforms
(String strTransforms) XML Signature transformations applied to the input.void
setWriteDefaultAttributes
(boolean boDefaultAttributes) Include attribute values defaulted from DTD in signed document.com.altova.raptorxml.JSONMap
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.altova.raptorxml.XMLDsig
getLastErrorMessage
-
Constructor Details
-
HTTPXMLDsig
public HTTPXMLDsig(com.altova.raptorxml.HTTPConnection connection, com.altova.raptorxml.AbstractRaptorXMLFactory parent)
-
-
Method Details
-
executeSign
public boolean executeSign(String strResultOutputFileName, String strSignatureType, String strSignatureCanonicalizationMethod) throws RaptorXMLException Description copied from interface:XMLDsig
Execute the sign command. It takes an XML document as input and creates an XML signature output document using the specified signing options. In case of an error, use functionXMLDsig.getLastErrorMessage()
to get additional information.- Specified by:
executeSign
in interfaceXMLDsig
- Parameters:
strResultOutputFileName
- Location of the result output filestrSignatureType
- Specifies the type of signature to be generated. (Examples: detached, enveloping, enveloped)strSignatureCanonicalizationMethod
- Specifies the canonicalization algorithm applied to the SignedInfo element. (Examples: xml-c14n11, REC-xml-c14n - 20010315, ...)- Returns:
- true on success, false on failure. In case of an error, use function
XMLDsig.getLastErrorMessage()
to get additional information. - Throws:
RaptorXMLException
-
executeVerify
Description copied from interface:XMLDsig
Execute the verify command. It verifies the XML signature of the input file. In case of an error, use functionXMLDsig.getLastErrorMessage()
to get additional information.- Specified by:
executeVerify
in interfaceXMLDsig
- Returns:
- true on success, false on failure. In case of an error, use function
XMLDsig.getLastErrorMessage()
to get additional information. - Throws:
RaptorXMLException
-
executeUpdate
Description copied from interface:XMLDsig
Execute the update command. It updates the XML signature in the signed input file. If the document has been modified, the XML signature will be different; otherwise, the updated signature will be the same as the previous signature. In case of an error, use functionXMLDsig.getLastErrorMessage()
to get additional information.- Specified by:
executeUpdate
in interfaceXMLDsig
- Parameters:
strResultOutputFileName
- Location of the result output file- Returns:
- true on success, false on failure. In case of an error, use function
XMLDsig.getLastErrorMessage()
to get additional information. - Throws:
RaptorXMLException
-
executeRemove
Description copied from interface:XMLDsig
Execute the remove command. It removes the XML signature of the signed input file, and saves the resulting unsigned document to an output location that you specify. In case of an error, use functionXMLDsig.getLastErrorMessage()
to get additional information.- Specified by:
executeRemove
in interfaceXMLDsig
- Returns:
- true on success, false on failure. In case of an error, use function
XMLDsig.getLastErrorMessage()
to get additional information. - Throws:
RaptorXMLException
-
setInputFileName
Description copied from interface:XMLDsig
Set the file name for the input XML data. Please note that you have to use absolute URLs.- Specified by:
setInputFileName
in interfaceXMLDsig
- Parameters:
filePath
- an absolute URL giving the base location of the XML data.
-
setHMACSecretKey
Description copied from interface:XMLDsig
Set the HMAC shared secret key; must have a minimum length of six characters.- Specified by:
setHMACSecretKey
in interfaceXMLDsig
- Parameters:
strSecretKey
- the HMAC shared secret key string.
-
setSignatureMethod
Description copied from interface:XMLDsig
Set the signature-method; Specifies the algorithm to use for generating the signatur. If a certificate is specified, than signature-method is optional and the value for this parameter is derived from the certificate. When specified, it must match the algorithm used by the certificate. Example: rsa-sha256 When hmac-secret-key is used, then this option is mandatory. The value must be one of the supported HMAC algorithms: hmac-sha256, hmac-sha386, hmac-sha512, hmac-sha1 (discoureged by the specification)- Specified by:
setSignatureMethod
in interfaceXMLDsig
-
setAbsoluteReferenceUri
public void setAbsoluteReferenceUri(boolean boAbsolute) Description copied from interface:XMLDsig
Specifies whether the URI of the signed document is to be read as absolute (true) or relative (false). Default is false.- Specified by:
setAbsoluteReferenceUri
in interfaceXMLDsig
-
setCertificateName
Description copied from interface:XMLDsig
The name of the certificate used for signing. Can't be used with --hmac-secret-key. [Windows: name of certificate in certificate-store, linux / macos: name of .PEM certificate file with private key.]- Specified by:
setCertificateName
in interfaceXMLDsig
- Parameters:
strCertName
- the certname string
-
setCertificateStore
Description copied from interface:XMLDsig
Certificate store that contains the certificate used for signing. [Windows only, mandatory when certificate-name is specified.]- Specified by:
setCertificateStore
in interfaceXMLDsig
- Parameters:
strCertStore
- the certstore string
-
setDigestMethod
Description copied from interface:XMLDsig
DigestMethod Algorithm used to compute the digest value over the input. [default: sha256]- Specified by:
setDigestMethod
in interfaceXMLDsig
-
setHMACOutputLength
public void setHMACOutputLength(int length) Description copied from interface:XMLDsig
Truncate the output of the HMAC algorithm to length. (multiple of 8, only in conjunction with --hmac-secret-key.)- Specified by:
setHMACOutputLength
in interfaceXMLDsig
-
setAppendKeyInfo
public void setAppendKeyInfo(boolean boAppend) Description copied from interface:XMLDsig
Append KeyInfo element to signature. [default: false]- Specified by:
setAppendKeyInfo
in interfaceXMLDsig
-
setTransforms
Description copied from interface:XMLDsig
XML Signature transformations applied to the input. (Examples: xml-c14n11, base64, strip-whitespaces)- Specified by:
setTransforms
in interfaceXMLDsig
-
setWriteDefaultAttributes
public void setWriteDefaultAttributes(boolean boDefaultAttributes) Description copied from interface:XMLDsig
Include attribute values defaulted from DTD in signed document. [default: false]- Specified by:
setWriteDefaultAttributes
in interfaceXMLDsig
-
toJSONMap
- Throws:
RaptorXMLException
-
getLastErrorMessage
-
getMainOutput
-
getAdditionalOutputs
-