Public Member Functions | |
AddReference (_.XML.Security.Reference reference, _.Library.Boolean doNotReuse) | |
Add a reference to XML element using an XML.Security.Reference. More... | |
_.xsd.base64Binary | ComputeSha1Digest (_.XML.Node node, _.Library.String signNodeId, _.XML.Writer writer, _.Library.String prefixList, _.Library.Integer bitlength, _.Library.Boolean isSTR, _.Library.FileBinaryStream text, _.Net.MIMEPart mimeAttachments) |
Compute SHA1 digest of an element. | |
SetDigestMethod (_.Library.String algorithm) | |
Set the digest method algorithm to be used for signing. More... | |
SetSignatureMethod (_.Library.String algorithm) | |
Set the signature method algorithm to be used for signing. More... | |
_.Library.Status | SignDocument (_.XML.Document document, _.Net.MIMEPart mimeAttachments) |
SignDocument completes the Signature element by adding the SignedInfo based on X509Credentials and. More... | |
_.Library.Status | SignStream (_.Library.BinaryStream messageStream, _.Net.MIMEPart mimeAttachments) |
SignStream completes the Signature element by adding the SignedInfo based on X509Credentials and. More... | |
_.Library.Status | ValidateDocument (_.XML.Document document, _.Net.MIMEPart mimeAttachments, _.Library.String CAFile) |
Validate a XML.Document containing a parsed XML document which contains a signature. More... | |
![]() | |
_.Library.Status | OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount) |
This callback method is invoked when the current object is added to the SaveSet,. More... | |
_.Library.Status | OnClose () |
This callback method is invoked by the <METHOD>Close</METHOD> method to. More... | |
_.Library.Status | OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned) |
This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More... | |
_.Library.Status | OnNew () |
This callback method is invoked by the <METHOD>New</METHOD> method to. More... | |
_.Library.Status | OnValidateObject () |
This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More... | |
![]() | |
_.Library.Status | XMLExport (_.Library.String top, _.Library.String format, _.XML.Namespaces namespaces, attrs, _.Library.String createId, _.Library.String typeAttr, oreflist, idlist, _.Library.String initialIndent, _.Library.Boolean local, _.Net.MIMEPart mimeAttachments) |
Serialize an XML enabled class as an XML document and write. More... | |
_.Library.Status | XMLExportToStream (_.Stream.Object export, _.Library.String top, _.Library.String format, _.XML.Namespaces namespaces, attrs, _.Library.String createId, _.Library.String typeAttr, oreflist, idlist, _.Library.String initialIndent) |
Serialize an XML enabled class as an XML document and appends it to a stream. More... | |
_.Library.Status | XMLExportToString (_.Library.String export, _.Library.String top, _.Library.String format, _.XML.Namespaces namespaces, attrs, _.Library.String createId, _.Library.String typeAttr, oreflist, idlist, _.Library.String initialIndent) |
Serialize an XML enabled class as an XML document and write it to a string. More... | |
Static Public Member Functions | |
_.XML.Security.Signature | Create (_.Library.RegisteredObject keyElement, _.Library.Integer signatureOptions, _.Library.Integer referenceOption) |
Create a Signature element that is to be signed using the hmac-sha1 algorithm. More... | |
_.XML.Security.Signature | CreateX509 (_.SYS.X509Credentials credentials, _.Library.Integer signatureOptions, _.Library.Integer referenceOption, _.Library.Status status) |
Create a Signature element that is to be signed using the RSA private key that. More... | |
_.Library.RegisteredObject | XMLNew (_.XML.Document document, _.Library.Integer nodeId, _.Library.RegisteredObject containerOref) |
Save the node if when getting a new class instance. | |
![]() | |
_.Library.Status | XMLDTD (_.Library.String top, _.Library.String format, _.Library.Boolean input, dtdlist) |
Write the DTD to the current device for this XML enabled class serialized as. More... | |
_.Library.Status | XMLSchema (_.Library.String top, _.Library.String format, _.Library.String namespacePrefix, _.Library.Boolean input, _.Library.Boolean refOnly, schema) |
Write an XML Schema fragment to the current device which describes an XML enabled class and dependent classes. More... | |
_.Library.String | XMLSchemaNamespace () |
Get the namespace to which this class belongs for use in schema generation. More... | |
_.Library.Status | XMLSchemaType (_.XML.Schema schemaInstance, _.XML.Node node, _.Library.String top, _.Library.Boolean encoded, _.Library.Boolean summary, _.Library.Boolean input, _.Library.Boolean refOnly) |
Add a complexType to the schema that is respresented by an <class>XML.Schema</class> instance. More... | |
Static Public Attributes | |
ELEMENTQUALIFIED = None | |
![]() | |
CAPTION = None | |
Optional name used by the Form Wizard for a class when generating forms. More... | |
JAVATYPE = None | |
The Java type to be used when exported. | |
PROPERTYVALIDATION = None | |
This parameter controls the default validation behavior for the object. More... | |
![]() | |
ATTRIBUTEQUALIFIED = None | |
ATTRIBUTEQUALIFIED controls the format of exported XML by controlling whether attributes. More... | |
ELEMENTQUALIFIED = None | |
ELEMENTQUALIFIED controls the format of exported XML. More... | |
NAMESPACE = None | |
NAMESPACE specifies the XML namespace to be used when projecting the. More... | |
SUPPRESSTYPEPREFIX = None | |
SUPPRESSTYPEPREFIX allows the type name that refers to this class. More... | |
XMLDEFAULTREFERENCE = None | |
XMLDEFAULTREFERENCE specifies the default value of the XMLREFERENCE property parameter. More... | |
XMLENABLED = None | |
If this parameter is true then XML-enabling methods. More... | |
XMLFORMAT = None | |
The XMLFORMAT parameter controls the generation of the XMLExport and XMLImport. More... | |
XMLIGNOREINVALIDATTRIBUTE = None | |
The XMLIGNOREINVALIDATTRIBUTE parameter allows the programmer to control handling of unexpected. More... | |
XMLIGNOREINVALIDTAG = None | |
The XMLIGNOREINVALIDTAG parameter allows the programmer to control handling of unexpected. More... | |
XMLIGNORENULL = None | |
XMLIGNORENULL allows the programmer to override the default XML handling. More... | |
XMLINCLUDEINGROUP = None | |
XMLINCLUDEINGROUP allows the programmer to control whether a class is included. More... | |
XMLINHERITANCE = None | |
If the XMLINHERITANCE parameter is set to "LEFT", then in the case of multiple. More... | |
XMLNAME = None | |
This parameter provides the default XMLNAME for the class. More... | |
XMLNIL = None | |
The XMLNIL class parameter controls the use of xsi:nil by XMLExport. More... | |
XMLNILNOOBJECT = None | |
The XMLNILNOOBJECT parameter allows creation of an object to be skipped for elements. More... | |
XMLPREFIX = None | |
The XMLPREFIX parameter controls the prefix to be used for the XML namespace that. More... | |
XMLSEQUENCE = None | |
If the XMLSEQUENCE = 1, then the order of the XML elements must match the. More... | |
XMLSUMMARY = None | |
The summary fields to be used when an object is referenced are specified. More... | |
XMLTYPE = None | |
This parameter provides the default XMLTYPE for the class. More... | |
XMLUNSWIZZLE = None | |
If the XMLUNSWIZZLE parameter is set to 1, then single object. More... | |
XMLUSEEMPTYELEMENT = None | |
If the XMLUSEEMPTYELEMENT parameter is set to 1, then the empty element shorthand (<tag>) More... | |
For details on using this class, see Signing XML Documents. and Adding Digital Signatures.
AddReference | ( | _.XML.Security.Reference | reference, |
_.Library.Boolean | doNotReuse | ||
) |
Add a reference to XML element using an XML.Security.Reference.
The reference may be created by using the ##class(XML.Security.Reference).Create method. If doNotReuse is true, then this reference will be removed during Reset
|
static |
Create a Signature element that is to be signed using the hmac-sha1 algorithm.
with a symmetric key specified by its KeyInfo element.
|
static |
Create a Signature element that is to be signed using the RSA private key that.
is associated with the specified X509 certificate.
SetDigestMethod | ( | _.Library.String | algorithm | ) |
Set the digest method algorithm to be used for signing.
The algorithm is reflected in the Algorithm attribute of the DigestMethod element of each Reference element of the SignedInfo element of the Signature element. Possible values for algortihm are $$$SOAPWSsha1, $$$SOAPWSsha256, $$$SOAPWSsha384 and $$$SOAPWSsha512.
SetSignatureMethod | ( | _.Library.String | algorithm | ) |
Set the signature method algorithm to be used for signing.
The algorithm is reflected in the Algorithm attribute of the SignatureMethod element the SignedInfo element of the Signature element. Possible values for algortihm are $$$SOAPWSrsasha1, $$$SOAPWSrsasha256, $$$SOAPWSrsasha384 and $$$SOAPWSrsasha512.
_.Library.Status SignDocument | ( | _.XML.Document | document, |
_.Net.MIMEPart | mimeAttachments | ||
) |
SignDocument completes the Signature element by adding the SignedInfo based on X509Credentials and.
computes the signature value for the parsed XML document to be signed. document is an XML.Document obtained by parsing the stream ot be signed.
If the document is an MTOM document, then the optional mimeAttachments argument contains a single MIME part which has each MIME section as one of its child Parts.
The following example creates a stream which contains an XML document whose root object is is given by the oref obj. This oref is assumed to be an instance of an XML-enabled class that has the following properties:
set writer=##class(XML.Writer).New() set stream=##class(FileBinaryStream).New() set status=writer.OutputToStream(stream) if $$$ISERR(status) do $system.OBJ.DisplayError(status) quit set status=writer.RootObject(obj) if $$$ISERR(status) do $system.OBJ.DisplayError(status) quit
set x509=##class(SYS.X509Credentials).GetByAlias("MyCredentials") set signature=##class(XML.Security.Signature).CreateX509( x509,$$$SOAPWSIncludeNone,$$$KeyInfoX509Certificate) // Signature based on id of contained Signed element // Note that name Signed is arbitrary. do signature.AddReference(
// We parse the stream to create a document which we will sign. set status=
if $$$ISERR(status) do $system.OBJ.DisplayError(status) quit set status=signature.SignDocument(document) if $$$ISERR(status) do $system.OBJ.DisplayError(status) quit // Signature element is property of any name // Signature is arbitrary property name set obj.Signature=signature
// Output the signed stream now that the signature is computed. set stream=##class(FileBinaryStream).New() set status=writer.OutputToStream(stream) if $$$ISERR(status) do $system.OBJ.DisplayError(status) quit set status=writer.RootObject(obj) if $$$ISERR(status) do $system.OBJ.DisplayError(status) quit
_.Library.Status SignStream | ( | _.Library.BinaryStream | messageStream, |
_.Net.MIMEPart | mimeAttachments | ||
) |
SignStream completes the Signature element by adding the SignedInfo based on X509Credentials and.
computes the signature value for the XML stream to be signed. messageStream is a stream containing the XML to be signed.
If the document is an MTOM document, then the optional mimeAttachments argument contains a single MIME part which has each MIME section as one of its child Parts.
The following example creates a stream which contains an XML document whose root object is is given by the oref obj. This oref is assumed to be an instance of an XML-enabled class that has the following properties:
set writer=##class(XML.Writer).New() set stream=##class(FileBinaryStream).New() set status=writer.OutputToStream(stream) if $$$ISERR(status) do $system.OBJ.DisplayError(status) quit set status=writer.RootObject(obj) if $$$ISERR(status) do $system.OBJ.DisplayError(status) quit
set x509 = ##class(SYS.X509Credentials).GetByAlias("MyCredentials") set signature=##class(XML.Security.Signature).CreateX509( x509,$$$SOAPWSIncludeNone,$$$KeyInfoX509Certificate) // Signature based on id of contained Signed element // Note that the name Signed is arbitrary. do signature.AddReference(
set status=signature.SignStream(stream) if $$$ISERR(status) do $system.OBJ.DisplayError(status) quit // Signature element is property of any name // Signature is an arbitrary property name set obj.Signature=signature
// Output the signed stream now that the signature is computed. set stream=##class(FileBinaryStream).New() set status=writer.OutputToStream(stream) if $$$ISERR(status) do $system.OBJ.DisplayError(status) quit set status=writer.RootObject(obj) if $$$ISERR(status) do $system.OBJ.DisplayError(status) quit
_.Library.Status ValidateDocument | ( | _.XML.Document | document, |
_.Net.MIMEPart | mimeAttachments, | ||
_.Library.String | CAFile | ||
) |
Validate a XML.Document containing a parsed XML document which contains a signature.
The XML.Signature element must be obtained from the same instance of XML.Document that you are validating. If invalid return an error Status.
If the document is an MTOM document, then the optional mimeAttachments argument contains a single MIME part which has each MIME section as one of its child Parts.
The CAFile argument is the full path of file which contains the certificate authority certificates which are to be used to validate the signing certificate.
The following example assumes a single argument web service method with the argument named arg. This will usually be the case with an entire message being the argument since Parameter ARGUMENTSTYLE = "message". The document to validate is the SOAP message whose XML.Document is contained in the ImportHandler property of the service. Also exclusive canonicalization must be used because the entire SOAP envelope is represented in ..Importhandler. If inclusive canonicalization needs to be used, then the ProcessBody or ProcessBodyNode methods must be used which allows access to just the Body contents as a document.
// Signature element is property of any name. // Signature is arbitrary property name set signature=arg.Signature set status=signature.ValidateDocument(..ImportHandler) if $$$ISERR(status) do $system.OBJ.DisplayError(status) quit
|
static |
For details on using this class, see Signing XML Documents. and Adding Digital Signatures.