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 TypeMethodDescriptionbooleanexecuteRemove(String strResultOutputFileName) Execute the remove command.booleanexecuteSign(String strResultOutputFileName, String strSignatureType, String strSignatureCanonicalizationMethod) Execute the sign command.booleanexecuteUpdate(String strResultOutputFileName) Execute the update command.booleanExecute the verify command.voidsetAbsoluteReferenceUri(boolean boAbsolute) Specifies whether the URI of the signed document is to be read as absolute (true) or relative (false).voidsetAppendKeyInfo(boolean boAppend) Append KeyInfo element to signature.voidsetCertificateName(String strCertName) The name of the certificate used for signing.voidsetCertificateStore(String strCertStore) Certificate store that contains the certificate used for signing.voidsetDigestMethod(String strDigestMethod) DigestMethod Algorithm used to compute the digest value over the input.voidsetHMACOutputLength(int length) Truncate the output of the HMAC algorithm to length.voidsetHMACSecretKey(String strSecretKey) Set the HMAC shared secret key; must have a minimum length of six characters.voidsetInputFileName(String filePath) Set the file name for the input XML data.voidsetSignatureMethod(String strSignatureMethod) Set the signature-method; Specifies the algorithm to use for generating the signatur.voidsetTransforms(String strTransforms) XML Signature transformations applied to the input.voidsetWriteDefaultAttributes(boolean boDefaultAttributes) Include attribute values defaulted from DTD in signed document.com.altova.raptorxml.JSONMapMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:XMLDsigExecute 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:
executeSignin 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:XMLDsigExecute 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:
executeVerifyin 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:XMLDsigExecute 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:
executeUpdatein 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:XMLDsigExecute 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:
executeRemovein 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:XMLDsigSet the file name for the input XML data. Please note that you have to use absolute URLs.- Specified by:
setInputFileNamein interfaceXMLDsig- Parameters:
filePath- an absolute URL giving the base location of the XML data.
-
setHMACSecretKey
Description copied from interface:XMLDsigSet the HMAC shared secret key; must have a minimum length of six characters.- Specified by:
setHMACSecretKeyin interfaceXMLDsig- Parameters:
strSecretKey- the HMAC shared secret key string.
-
setSignatureMethod
Description copied from interface:XMLDsigSet 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:
setSignatureMethodin interfaceXMLDsig
-
setAbsoluteReferenceUri
public void setAbsoluteReferenceUri(boolean boAbsolute) Description copied from interface:XMLDsigSpecifies whether the URI of the signed document is to be read as absolute (true) or relative (false). Default is false.- Specified by:
setAbsoluteReferenceUriin interfaceXMLDsig
-
setCertificateName
Description copied from interface:XMLDsigThe 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:
setCertificateNamein interfaceXMLDsig- Parameters:
strCertName- the certname string
-
setCertificateStore
Description copied from interface:XMLDsigCertificate store that contains the certificate used for signing. [Windows only, mandatory when certificate-name is specified.]- Specified by:
setCertificateStorein interfaceXMLDsig- Parameters:
strCertStore- the certstore string
-
setDigestMethod
Description copied from interface:XMLDsigDigestMethod Algorithm used to compute the digest value over the input. [default: sha256]- Specified by:
setDigestMethodin interfaceXMLDsig
-
setHMACOutputLength
public void setHMACOutputLength(int length) Description copied from interface:XMLDsigTruncate the output of the HMAC algorithm to length. (multiple of 8, only in conjunction with --hmac-secret-key.)- Specified by:
setHMACOutputLengthin interfaceXMLDsig
-
setAppendKeyInfo
public void setAppendKeyInfo(boolean boAppend) Description copied from interface:XMLDsigAppend KeyInfo element to signature. [default: false]- Specified by:
setAppendKeyInfoin interfaceXMLDsig
-
setTransforms
Description copied from interface:XMLDsigXML Signature transformations applied to the input. (Examples: xml-c14n11, base64, strip-whitespaces)- Specified by:
setTransformsin interfaceXMLDsig
-
setWriteDefaultAttributes
public void setWriteDefaultAttributes(boolean boDefaultAttributes) Description copied from interface:XMLDsigInclude attribute values defaulted from DTD in signed document. [default: false]- Specified by:
setWriteDefaultAttributesin interfaceXMLDsig
-
toJSONMap
- Throws:
RaptorXMLException
-
getLastErrorMessage
-
getMainOutput
-
getAdditionalOutputs
-