CryptXmlCreateReference function (cryptxml.h)

The CryptXmlCreateReference function creates a reference to an XML signature.

Syntax

HRESULT CryptXmlCreateReference(
  [in]           HCRYPTXML                 hCryptXml,
                 DWORD                     dwFlags,
  [in, optional] LPCWSTR                   wszId,
  [in, optional] LPCWSTR                   wszURI,
  [in, optional] LPCWSTR                   wszType,
  [in]           const CRYPT_XML_ALGORITHM *pDigestMethod,
                 ULONG                     cTransform,
  [in]           const CRYPT_XML_ALGORITHM *rgTransform,
  [out]          HCRYPTXML                 *phReference
);

Parameters

[in] hCryptXml

The handle of the XML signature.

dwFlags

Specifies flags that affect how the reference is created.

Currently defined dwFlags values are shown in the following table.

Value Meaning
CRYPT_XML_FLAG_CREATE_REFERENCE_AS_OBJECT
0x00000001
Set this flag to create an Object node and add it to the Signature element. A reference to the Object node is created in the SignedInfo element.

The returned handle is an encapsulated Object node and can be used in subsequent calls to the CryptXmlCreateReference function to create references in the Manifest node.

[in, optional] wszId

A pointer to a null-terminated Unicode string that contains the value of the ID attribute of the Reference element of the signature. If this parameter is NULL, then the ID attribute is not created. If this parameter is an empty string, then the ID attribute with empty value is created.

[in, optional] wszURI

A pointer to a null-terminated Unicode string that contains the value of the URI attribute of the Reference element of the signature. If this parameter is an empty string, then the URI attribute with an empty value is created.

[in, optional] wszType

A pointer to a null-terminated Unicode string that contains the value of the Type attribute of the Reference element of the signature. The processing engine does not check or use this attribute.

[in] pDigestMethod

A pointer to a CRYPT_XML_ALGORITHM structure that contains the digest method.

cTransform

The number of elements in the array pointed to by the rgTransform parameter.

[in] rgTransform

A pointer to an ordered array of CRYPT_XML_ALGORITHM structures that contain transform algorithms to be applied to the reference data before the digest calculation.

[out] phReference

A pointer to a reference handle.

Return value

If the function succeeds, the function returns zero.

If the function fails, it returns an HRESULT value that indicates the error.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header cryptxml.h
Library Cryptxml.lib
DLL Cryptxml.dll