IOpcSignatureCustomObject::GetXml method

Gets the XML markup of an application-specific Object element.

Syntax


HRESULT GetXml(
  [out] UINT8  **xmlMarkup,
  [out] UINT32 *count
);

Parameters

xmlMarkup [out]

A pointer to a buffer that contains the XML markup of an Object element and includes the opening and closing Object tags.

In the buffer, XML markup is preceded by a byte order mark that corresponds to the encoding of the markup.

Supported encodings and byte order mark values.

EncodingDescriptionByte order mark
UTF8UTF-8EF BB BF
UTF16LEUTF-16, little endianFF FE
UTF16BEUTF-16, big endianFE FF

 

For an example of a buffer with a byte order mark, see the Remarks section.

count [out]

A pointer to the size of the xmlMarkup buffer.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return codeDescription
S_OK

The method succeeded.

E_POINTER

At least one of the xmlMarkup, and count parameters is NULL.

 

Remarks

This method allocates memory used by the buffer returned in xmlMarkup. If the method succeeds, call the CoTaskMemFree function to free the memory.

Serialized application-specific Object elements in signature markup can be added, removed, or modified by replacing the signature markup.

To replace signature markup, call the IOpcDigitalSignatureManager::ReplaceSignatureXml method. The caller must ensure that addition, deletion, or modification of application-specific Object elements does not break the signature.

To sign an application-specific Object element or a child of that element, create a reference to the XML element to be signed. Create the reference by calling the IOpcSignatureReferenceSet::Create method with the referenceUri parameter value set to "#" followed by the Id attribute value of the referenced element. For example, if the Id attribute of the referenced element is "Application", set referenceUri to "#Application".

The following table shows a byte order mark at the beginning of an xmlMarkup buffer that contains "<Object Id="id1"></Object>":

Buffer Byte Index01234567...
UTF8 ValueEFBBBF'<''O''b''j''e'...
UTF16LE ValueFFFE'<'00'O'00'b'00...

 

Thread Safety

Packaging objects are not thread-safe.

For more information, see the Getting Started with the Packaging API.

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Msopc.h

IDL

Msopc.idl

See also

IOpcSignatureCustomObject
Overviews
Getting Started with the Packaging API
Packaging API Programming Guide
Reference
IOpcDigitalSignatureManager
IOpcSignatureReferenceSet
Core Packaging Interfaces
Packaging Digital Signature Interfaces
Packaging Interfaces
Packaging API Reference
Packaging API Samples

 

 

Community Additions

ADD
Show: