SignatureContext (open)
Object containing functions to sign and validate XML documents with the XML Signature standard
Syntax
LOADLIB "wh::xml/signature.whlib";
OBJECTTYPE SignatureContext
Properties
- PROPERTY certificate
Current certificate, read from the <Signature> element. Write to set/override.
Functions
- OBJECT FUNCTION GetSignedPart(OBJECT elt)
Extract the signed part of an element (as a separate document)
- OBJECT FUNCTION GetSignedXMLDocument()
Return a copy of the document with all the unsigned nodes within the selected nodes removed.
- MACRO SetX509Certificate(STRING cert)
Use to override the certificate used for validation
- MACRO SignDocument(STRING privatekey, STRING passhrase)
Fills the <Signature> node by with the <Reference> element digests, and the final signature.
- MACRO ValidateSignature()
Validates the signature. Throws if it doesn't validate.