---
product: Chilkat
product_version: 11.7.0
language: wc
language_label: Unicode C
class: XmlDSig
license: bundle
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/wc_CkXmlDSigWRef.html
---
# Chilkat XmlDSig — Unicode C — v11.7.0

> Chilkat 11.7.0 · language=wc · class=XmlDSig
> Other versions: replace `11.7.0` in this URL. Other languages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/<lang>/classes/XmlDSig.md`.
> Language-wide rules (install, unlock, error model, strings/bytes): `https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/guide.md`.

## Purpose

**Load, inspect, canonicalize, and verify XML Digital Signatures.**

`Chilkat.XmlDSig` loads and verifies XML Digital Signatures. It can inspect signed XML, select among multiple signatures in one document, verify the overall `SignatureValue`, verify individual `Reference` digests, handle external references, extract `KeyInfo`, retrieve embedded certificates or public keys, canonicalize XML, and add an `EncapsulatedTimeStamp` to an existing signature.

**Load signed XML**

Load an XML document containing one or more digital signatures and inspect the signature structure before verification.

**Select a signature**

Work with documents that contain multiple signatures by selecting the specific signature to inspect or verify.

**Verify SignatureValue**

Verify the cryptographic signature over the canonicalized `SignedInfo` block.

**Verify Reference digests**

Check individual `Reference` digest values to confirm that each signed item still matches what was originally signed.

**Certificates and keys**

Extract `KeyInfo`, embedded signing certificates, or public keys used to validate the signature.

**Canonicalization and timestamps**

Canonicalize XML for signature analysis and add an `EncapsulatedTimeStamp` when timestamping an existing signature.

**Common pattern:** Load the signed XML, select the desired signature if more than one is present, inspect the signing certificate or public key information, verify the `SignatureValue`, then verify the individual reference digests. Use `XmlDSig` for verification and inspection; use `Chilkat.XmlDSigGen` when creating new XML Digital Signatures.

For an extended overview, see [XmlDSig Class Overview](https://www.chilkatsoft.com/xmldsig_class_overview.asp).

## Object creation, unlocking and error handling

**Create/Dispose**

```c
HCkXmlDSigW instance = CkXmlDSigW_Create();
// ...
CkXmlDSigW_Dispose(instance);
```

`HCkXmlDSigW CkXmlDSigW_Create(void);`

Creates an instance of the HCkXmlDSigW object and returns a handle ("void \*" pointer). The handle is passed in the 1st argument for the functions listed on this page.

`void CkXmlDSigW_Dispose(HCkXmlDSigW handle);`

Objects created by calling CkXmlDSigW_Create must be freed by calling this method. A memory leak occurs if a handle is not disposed by calling this function. Also, any handle returned by a Chilkat "C" function must also be freed by the application by calling the appropriate Dispose method, such as CkXmlDSigW_Dispose.

Call `Global.UnlockBundle` once at the start of the program, before using this or any other Chilkat class. Any string unlocks a fully functional 30-day trial; a purchased unlock code is used in production. See `guide.md` for the exact code in Unicode C.

## Members common to every Chilkat class

Documented once per language in `common-members.md`; listed here so this page is self-contained.

| Property | Signature | Access | Meaning |
|---|---|---|---|
| `DebugLogFilePath` | `void CkXmlDSigW_getDebugLogFilePath(HCkXmlDSigW cHandle, HCkString retval); void CkXmlDSigW_putDebugLogFilePath(HCkXmlDSigW cHandle, const wchar_t *newVal); const wchar_t *CkXmlDSigW_debugLogFilePath(HCkXmlDSigW cHandle);` | read/write | If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. |
| `LastErrorHtml` | `void CkXmlDSigW_getLastErrorHtml(HCkXmlDSigW cHandle, HCkString retval); const wchar_t *CkXmlDSigW_lastErrorHtml(HCkXmlDSigW cHandle);` | read-only | Provides HTML-formatted information about the last called method or property. |
| `LastErrorText` | `void CkXmlDSigW_getLastErrorText(HCkXmlDSigW cHandle, HCkString retval); const wchar_t *CkXmlDSigW_lastErrorText(HCkXmlDSigW cHandle);` | read-only | Provides plain text information about the last called method or property. |
| `LastErrorXml` | `void CkXmlDSigW_getLastErrorXml(HCkXmlDSigW cHandle, HCkString retval); const wchar_t *CkXmlDSigW_lastErrorXml(HCkXmlDSigW cHandle);` | read-only | Provides XML-formatted information about the last called method or property. |
| `LastMethodSuccess` | `BOOL CkXmlDSigW_getLastMethodSuccess(HCkXmlDSigW cHandle); void CkXmlDSigW_putLastMethodSuccess(HCkXmlDSigW cHandle, BOOL newVal);` | read/write | Indicates the success or failure of the most recent method call: `TRUE` means success, `FALSE` means failure. |
| `VerboseLogging` | `BOOL CkXmlDSigW_getVerboseLogging(HCkXmlDSigW cHandle); void CkXmlDSigW_putVerboseLogging(HCkXmlDSigW cHandle, BOOL newVal);` | read/write | If set to `TRUE`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. |
| `Version` | `void CkXmlDSigW_getVersion(HCkXmlDSigW cHandle, HCkString retval); const wchar_t *CkXmlDSigW_version(HCkXmlDSigW cHandle);` | read-only | Version of the component/library, such as "10.1.0" |

## Member index

| Member | Kind | Signature |
|---|---|---|
| `ExternalRefDirs` | property, read/write | `void CkXmlDSigW_getExternalRefDirs(HCkXmlDSigW cHandle, HCkString retval); void CkXmlDSigW_putExternalRefDirs(HCkXmlDSigW cHandle, const wchar_t *newVal); const wchar_t *CkXmlDSigW_externalRefDirs(HCkXmlDSigW cHandle);` |
| `IgnoreExternalRefs` | property, read/write | `BOOL CkXmlDSigW_getIgnoreExternalRefs(HCkXmlDSigW cHandle); void CkXmlDSigW_putIgnoreExternalRefs(HCkXmlDSigW cHandle, BOOL newVal);` |
| `NumReferences` | property, read-only | `int CkXmlDSigW_getNumReferences(HCkXmlDSigW cHandle);` |
| `NumSignatures` | property, read-only | `int CkXmlDSigW_getNumSignatures(HCkXmlDSigW cHandle);` |
| `RefFailReason` | property, read-only | `int CkXmlDSigW_getRefFailReason(HCkXmlDSigW cHandle);` |
| `Selector` | property, read/write | `int CkXmlDSigW_getSelector(HCkXmlDSigW cHandle); void CkXmlDSigW_putSelector(HCkXmlDSigW cHandle, int newVal);` |
| `UncommonOptions` | property, read/write | `void CkXmlDSigW_getUncommonOptions(HCkXmlDSigW cHandle, HCkString retval); void CkXmlDSigW_putUncommonOptions(HCkXmlDSigW cHandle, const wchar_t *newVal); const wchar_t *CkXmlDSigW_uncommonOptions(HCkXmlDSigW cHandle);` |
| `AddEncapsulatedTimeStamp` | method | `BOOL CkXmlDSigW_AddEncapsulatedTimeStamp(HCkXmlDSigW cHandle, HCkJsonObjectW json, HCkStringBuilderW sbOut);` |
| `CanonicalizeFragment` | method | `BOOL CkXmlDSigW_CanonicalizeFragment(HCkXmlDSigW cHandle, const wchar_t *xml, const wchar_t *fragmentId, const wchar_t *version, const wchar_t *prefixList, BOOL withComments, const wchar_t *outStr); const wchar_t *CkXmlDSigW_canonicalizeFragment(HCkXmlDSigW cHandle, const wchar_t *xml, const wchar_t *fragmentId, const wchar_t *version, const wchar_t *prefixList, BOOL withComments);` |
| `CanonicalizeXml` | method | `BOOL CkXmlDSigW_CanonicalizeXml(HCkXmlDSigW cHandle, const wchar_t *xml, const wchar_t *version, BOOL withComments, const wchar_t *outStr); const wchar_t *CkXmlDSigW_canonicalizeXml(HCkXmlDSigW cHandle, const wchar_t *xml, const wchar_t *version, BOOL withComments);` |
| `GetCerts` | method | `BOOL CkXmlDSigW_GetCerts(HCkXmlDSigW cHandle, HCkStringArrayW sa);` |
| `GetKeyInfo` | method | `HCkXmlW CkXmlDSigW_GetKeyInfo(HCkXmlDSigW cHandle);` |
| `GetPublicKey` | method | `HCkPublicKeyW CkXmlDSigW_GetPublicKey(HCkXmlDSigW cHandle);` |
| `HasEncapsulatedTimeStamp` | method | `BOOL CkXmlDSigW_HasEncapsulatedTimeStamp(HCkXmlDSigW cHandle);` |
| `IsReferenceExternal` | method | `BOOL CkXmlDSigW_IsReferenceExternal(HCkXmlDSigW cHandle, int index);` |
| `LoadSignature` | method | `BOOL CkXmlDSigW_LoadSignature(HCkXmlDSigW cHandle, const wchar_t *xmlSig);` |
| `LoadSignatureBd` | method | `BOOL CkXmlDSigW_LoadSignatureBd(HCkXmlDSigW cHandle, HCkBinDataW binData);` |
| `LoadSignatureSb` | method | `BOOL CkXmlDSigW_LoadSignatureSb(HCkXmlDSigW cHandle, HCkStringBuilderW sbXmlSig);` |
| `ReferenceUri` | method | `BOOL CkXmlDSigW_ReferenceUri(HCkXmlDSigW cHandle, int index, const wchar_t *outStr); const wchar_t *CkXmlDSigW_referenceUri(HCkXmlDSigW cHandle, int index);` |
| `SetHmacKey` | method | `BOOL CkXmlDSigW_SetHmacKey(HCkXmlDSigW cHandle, const wchar_t *key, const wchar_t *encoding);` |
| `SetHttpObj` | method | `void CkXmlDSigW_SetHttpObj(HCkXmlDSigW cHandle, HCkHttpW http);` |
| `SetPublicKey` | method | `BOOL CkXmlDSigW_SetPublicKey(HCkXmlDSigW cHandle, HCkPublicKeyW pubKey);` |
| `SetRefDataBd` | method | `BOOL CkXmlDSigW_SetRefDataBd(HCkXmlDSigW cHandle, int index, HCkBinDataW binData);` |
| `SetRefDataFile` | method | `BOOL CkXmlDSigW_SetRefDataFile(HCkXmlDSigW cHandle, int index, const wchar_t *path);` |
| `SetRefDataSb` | method | `BOOL CkXmlDSigW_SetRefDataSb(HCkXmlDSigW cHandle, int index, HCkStringBuilderW sb, const wchar_t *charset);` |
| `UseCertVault` | method | `BOOL CkXmlDSigW_UseCertVault(HCkXmlDSigW cHandle, HCkXmlCertVaultW certVault);` |
| `VerifyReferenceDigest` | method | `BOOL CkXmlDSigW_VerifyReferenceDigest(HCkXmlDSigW cHandle, int index);` |
| `VerifySignature` | method | `BOOL CkXmlDSigW_VerifySignature(HCkXmlDSigW cHandle, BOOL verifyReferenceDigests);` |

## Properties

### XmlDSig.ExternalRefDirs

`Chilkat 11.7.0 · wc · XmlDSig · ExternalRefDirs · property · read/write · since 9.5.0.77`

```c
void CkXmlDSigW_getExternalRefDirs(HCkXmlDSigW cHandle, HCkString retval);
void CkXmlDSigW_putExternalRefDirs(HCkXmlDSigW cHandle, const wchar_t *newVal);
const wchar_t *CkXmlDSigW_externalRefDirs(HCkXmlDSigW cHandle);
```

May contain a set of directory paths specifying where referenced external files are located. Directory paths should be separated using a semicolon character. The default value of this property is the empty string which means no directories are automatically searched.

This property can be used if the external file referenced in the XML signature has the same filename as the file in the local filesystem.

### XmlDSig.IgnoreExternalRefs

`Chilkat 11.7.0 · wc · XmlDSig · IgnoreExternalRefs · property · read/write · since 9.5.0.77`

```c
BOOL CkXmlDSigW_getIgnoreExternalRefs(HCkXmlDSigW cHandle);
void CkXmlDSigW_putIgnoreExternalRefs(HCkXmlDSigW cHandle, BOOL newVal);
```

If `TRUE`, then ignore failures caused by external references not being available. This allows for the XML signature to be at least partially validated if the external referenced files are not available. The default value of this property is `FALSE`.

### XmlDSig.NumReferences

`Chilkat 11.7.0 · wc · XmlDSig · NumReferences · property · read-only · since 9.5.0.69`

```c
int CkXmlDSigW_getNumReferences(HCkXmlDSigW cHandle);
```

The number of data objects referenced in the XML digital signature. A data object may be self-contained within the loaded XML signature, or it may be an external URI reference. An application can check each reference to see if it's external by calling IsReferenceExternal, and can get each reference URI by calling ReferenceUri.

### XmlDSig.NumSignatures

`Chilkat 11.7.0 · wc · XmlDSig · NumSignatures · property · read-only · since 9.5.0.69`

```c
int CkXmlDSigW_getNumSignatures(HCkXmlDSigW cHandle);
```

The number of digital signatures found within the loaded XML. Each digital signature is composed of XML having the following structure:

```
  <Signature ID?> 
     <SignedInfo>
       <CanonicalizationMethod/>
       <SignatureMethod/>
       (<Reference URI? >
         (<Transforms>)?
         <DigestMethod>
         <DigestValue>
       </Reference>)+
     </SignedInfo>
     <SignatureValue> 
    (<KeyInfo>)?
    (<Object ID?>)*
 </Signature>
```

Note: The `Signature` and other XML tags may be namespace prefixed.

The Selector property is used to select which XML signature is in effect when validating or calling other methods or properties.

See also:

- [Online Tool to Verify XML Signature](http://tools.chilkat.io/xmlDsigVerify.cshtml)

### XmlDSig.RefFailReason

`Chilkat 11.7.0 · wc · XmlDSig · RefFailReason · property · read-only · since 9.5.0.77`

```c
int CkXmlDSigW_getRefFailReason(HCkXmlDSigW cHandle);
```

Indicates the failure reason for the last call to VerifyReferenceDigest. Possible values are:

- **0:** No failure, the reference digest was valid.
- **1:** The computed digest differs from the digest stored in the XML.
- **2:** An external file is referenced, but it is unavailable for computing the digest.
- **3:** The index argument passed to VerifyReferenceDigest was out of range.
- **4:** Unable to find the Signature.
- **5:** A transformation specified some sort of XML canonicalization that is not supported.
- **99:** Unknown. (Should never get this value.)

### XmlDSig.Selector

`Chilkat 11.7.0 · wc · XmlDSig · Selector · property · read/write · since 9.5.0.69`

```c
int CkXmlDSigW_getSelector(HCkXmlDSigW cHandle);
void CkXmlDSigW_putSelector(HCkXmlDSigW cHandle, int newVal);
```

If the loaded XML contains multiple signatures, this property can be set to specify which signature is in effect when calling other methods or properties. In most cases, the loaded XML contains a single signature and this property will remain at the default value of 0.

### XmlDSig.UncommonOptions

`Chilkat 11.7.0 · wc · XmlDSig · UncommonOptions · property · read/write · since 9.5.0.90`

```c
void CkXmlDSigW_getUncommonOptions(HCkXmlDSigW cHandle, HCkString retval);
void CkXmlDSigW_putUncommonOptions(HCkXmlDSigW cHandle, const wchar_t *newVal);
const wchar_t *CkXmlDSigW_uncommonOptions(HCkXmlDSigW cHandle);
```

This is a catch-all property to be used for uncommon needs. This property defaults to the empty string, and should typically remain empty.

## Methods

### XmlDSig.AddEncapsulatedTimeStamp

`Chilkat 11.7.0 · wc · XmlDSig · AddEncapsulatedTimeStamp · method · since 9.5.0.90`

```c
BOOL CkXmlDSigW_AddEncapsulatedTimeStamp(HCkXmlDSigW cHandle, HCkJsonObjectW json, HCkStringBuilderW sbOut);
```

Adds an EncapsulatedTimeStamp to the signature indicated by the Selector property. The updated signed XML with the added EncapsulatedTimeStamp is returned in `sbOut`. See the example below for details.

Returns TRUE for success, FALSE for failure.

### XmlDSig.CanonicalizeFragment

`Chilkat 11.7.0 · wc · XmlDSig · CanonicalizeFragment · method`

```c
BOOL CkXmlDSigW_CanonicalizeFragment(HCkXmlDSigW cHandle, const wchar_t *xml, const wchar_t *fragmentId, const wchar_t *version, const wchar_t *prefixList, BOOL withComments, const wchar_t *outStr);
const wchar_t *CkXmlDSigW_canonicalizeFragment(HCkXmlDSigW cHandle, const wchar_t *xml, const wchar_t *fragmentId, const wchar_t *version, const wchar_t *prefixList, BOOL withComments);
```

Applies XML canonicalization to a fragment of the passed-in XML, and returns the canonicalized XML string. The `fragmentId` identifies the XML element where output begins. It is the XML element having an `id` attribute equal to `fragmentId`. The `version` may be one of the following:

- `C14N` -- for Inclusive Canonical XML
- `EXCL_C14N` -- for Exclusive Canonical XML

The `prefixList` only applies when the `version` is set to `EXCL_C14N`. The `prefixList` may be an empty string, or a SPACE separated list of namespace prefixes. It is the InclusiveNamespaces PrefixList, which is the list of namespaces that are propagated from ancestor elements for canonicalization purposes.

If `withComments` is `TRUE`, then XML comments are included in the output. If `withComments` is `FALSE`, then XML comments are excluded from the output.

Returns TRUE for success, FALSE for failure.

### XmlDSig.CanonicalizeXml

`Chilkat 11.7.0 · wc · XmlDSig · CanonicalizeXml · method`

```c
BOOL CkXmlDSigW_CanonicalizeXml(HCkXmlDSigW cHandle, const wchar_t *xml, const wchar_t *version, BOOL withComments, const wchar_t *outStr);
const wchar_t *CkXmlDSigW_canonicalizeXml(HCkXmlDSigW cHandle, const wchar_t *xml, const wchar_t *version, BOOL withComments);
```

Applies XML canonicalization to the passed-in XML, and returns the canonicalized XML string. The `version` may be one of the following:

- `C14N` -- for Inclusive Canonical XML
- `EXCL_C14N` -- for Exclusive Canonical XML

If `withComments` is `TRUE`, then XML comments are included in the output. If `withComments` is `FALSE`, then XML comments are excluded from the output.

Returns TRUE for success, FALSE for failure.

See also:

- [Xml Canonicalizer Online Tool](https://tools.chilkat.io/XmlCanonicalize.cshtml)

### XmlDSig.GetCerts

`Chilkat 11.7.0 · wc · XmlDSig · GetCerts · method · since 9.5.0.76`

```c
BOOL CkXmlDSigW_GetCerts(HCkXmlDSigW cHandle, HCkStringArrayW sa);
```

Returns the certificates found in the signature indicated by the Selector property. The base64 representation of each certificate is returned.

Returns TRUE for success, FALSE for failure.

### XmlDSig.GetKeyInfo

`Chilkat 11.7.0 · wc · XmlDSig · GetKeyInfo · method · since 9.5.0.69`

```c
HCkXmlW CkXmlDSigW_GetKeyInfo(HCkXmlDSigW cHandle);
```

Returns the KeyInfo XML for the signature indicated by the Selector property. Returns `NULL` if no KeyInfo exists.

Returns `NULL` on failure

### XmlDSig.GetPublicKey

`Chilkat 11.7.0 · wc · XmlDSig · GetPublicKey · method · since 9.5.0.69`

```c
HCkPublicKeyW CkXmlDSigW_GetPublicKey(HCkXmlDSigW cHandle);
```

Returns the public key from the KeyInfo XML for the signature indicated by the Selector property. Returns `NULL` if no KeyInfo exists, or if no public key is actually contained in the KeyInfo.

Returns `NULL` on failure

### XmlDSig.HasEncapsulatedTimeStamp

`Chilkat 11.7.0 · wc · XmlDSig · HasEncapsulatedTimeStamp · method · since 9.5.0.90`

```c
BOOL CkXmlDSigW_HasEncapsulatedTimeStamp(HCkXmlDSigW cHandle);
```

Returns `TRUE` if the signature indicated by the Selector property contains an EncapsulatedTimeStamp. Otherwise returns `FALSE`.

### XmlDSig.IsReferenceExternal

`Chilkat 11.7.0 · wc · XmlDSig · IsReferenceExternal · method · since 9.5.0.69`

```c
BOOL CkXmlDSigW_IsReferenceExternal(HCkXmlDSigW cHandle, int index);
```

Returns `TRUE` if the reference at `index` is external. Each external reference would first need to be provided by the application prior to validating the signature.

### XmlDSig.LoadSignature

`Chilkat 11.7.0 · wc · XmlDSig · LoadSignature · method · since 9.5.0.69`

```c
BOOL CkXmlDSigW_LoadSignature(HCkXmlDSigW cHandle, const wchar_t *xmlSig);
```

Loads an XML document containing 1 or more XML digital signatures. An application would first load XML containing digital signature(s), then validate. After loading, it is also possible to use various methods and properties to get information about the signature, such as the key info, references, etc. If external data is referenced by the signature, it may be necessary to provide the referenced data prior to validating.

Note: When loading an XML document, the Selector property is automatically reset to 0, and the NumSignatures property is set to the number of XML digital signatures found.

Returns TRUE for success, FALSE for failure.

### XmlDSig.LoadSignatureBd

`Chilkat 11.7.0 · wc · XmlDSig · LoadSignatureBd · method · since 9.5.0.69`

```c
BOOL CkXmlDSigW_LoadSignatureBd(HCkXmlDSigW cHandle, HCkBinDataW binData);
```

Loads an XML document containing one or more XML digital signatures from the contents of a BinData object. An application would first load the XML, then validate. After loading, it is also possible to use various methods and properties to get information about the signature, such as the key info, references, etc. If external data is referenced by the signature, it may be necessary to provide the referenced data prior to validating.

Note: When loading an XML document, the Selector property is automatically reset to 0, and the NumSignatures property is set to the number of XML digital signatures found.

Returns TRUE for success, FALSE for failure.

### XmlDSig.LoadSignatureSb

`Chilkat 11.7.0 · wc · XmlDSig · LoadSignatureSb · method · since 9.5.0.69`

```c
BOOL CkXmlDSigW_LoadSignatureSb(HCkXmlDSigW cHandle, HCkStringBuilderW sbXmlSig);
```

Loads an XML document containing one or more XML digital signatures from the contents of a StringBuilder object. An application would first load the XML, then validate. After loading, it is also possible to use various methods and properties to get information about the signature, such as the key info, references, etc. If external data is referenced by the signature, it may be necessary to provide the referenced data prior to validating.

Note: When loading an XML document, the Selector property is automatically reset to 0, and the NumSignatures property is set to the number of XML digital signatures found.

Returns TRUE for success, FALSE for failure.

### XmlDSig.ReferenceUri

`Chilkat 11.7.0 · wc · XmlDSig · ReferenceUri · method · since 9.5.0.69`

```c
BOOL CkXmlDSigW_ReferenceUri(HCkXmlDSigW cHandle, int index, const wchar_t *outStr);
const wchar_t *CkXmlDSigW_referenceUri(HCkXmlDSigW cHandle, int index);
```

Returns the URI of the Nth reference specified by `index`. (The 1st reference is at index 0.) URI's beginning with a pound sign ('#') are internal references.

Returns TRUE for success, FALSE for failure.

### XmlDSig.SetHmacKey

`Chilkat 11.7.0 · wc · XmlDSig · SetHmacKey · method · since 9.5.0.69`

```c
BOOL CkXmlDSigW_SetHmacKey(HCkXmlDSigW cHandle, const wchar_t *key, const wchar_t *encoding);
```

**Full documentation for this method (same in every language):** [Binary Encodings Supported by Chilkat](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/binary_encodings.md)

Sets the HMAC key to be used if the Signature used an HMAC signing algorithm. The `encoding` specifies the encoding of `key`, and can be `hex`, `base64`, `ascii`, or any of the binary encodings supported by Chilkat in the link below.

Returns TRUE for success, FALSE for failure.

### XmlDSig.SetHttpObj

`Chilkat 11.7.0 · wc · XmlDSig · SetHttpObj · method · since 9.5.0.90`

```c
void CkXmlDSigW_SetHttpObj(HCkXmlDSigW cHandle, HCkHttpW http);
```

Sets the HTTP object to be used to communicate with OCSP responders, CRL distribution points, or timestamp authority (TSA) servers if needed. The `http` is used to send the requests, and it allows for connection related settings and timeouts to be set. For example, if HTTP or SOCKS proxies are required, these features can be specified on the `http`.

### XmlDSig.SetPublicKey

`Chilkat 11.7.0 · wc · XmlDSig · SetPublicKey · method · since 9.5.0.69`

```c
BOOL CkXmlDSigW_SetPublicKey(HCkXmlDSigW cHandle, HCkPublicKeyW pubKey);
```

Sets the public key to be used for verifying the signature indicated by the Selector property. A public key only needs to be explicitly provided by the application for those XML signatures where the public key is not already available within the KeyInfo of the Signature. In some cases, the KeyInfo within the Signature contains information about what public key was used for signing. The application can use this information to retrieve the matching public key and provide it via this method.

Returns TRUE for success, FALSE for failure.

### XmlDSig.SetRefDataBd

`Chilkat 11.7.0 · wc · XmlDSig · SetRefDataBd · method · since 9.5.0.69`

```c
BOOL CkXmlDSigW_SetRefDataBd(HCkXmlDSigW cHandle, int index, HCkBinDataW binData);
```

Provides the binary data for the external reference at `index`.

Returns TRUE for success, FALSE for failure.

### XmlDSig.SetRefDataFile

`Chilkat 11.7.0 · wc · XmlDSig · SetRefDataFile · method · since 9.5.0.69`

```c
BOOL CkXmlDSigW_SetRefDataFile(HCkXmlDSigW cHandle, int index, const wchar_t *path);
```

Provides the data for the external reference at `index`. When validating the signature, the data contained in `path` will be streamed to compute the digest for validation.

Returns TRUE for success, FALSE for failure.

### XmlDSig.SetRefDataSb

`Chilkat 11.7.0 · wc · XmlDSig · SetRefDataSb · method · since 9.5.0.69`

```c
BOOL CkXmlDSigW_SetRefDataSb(HCkXmlDSigW cHandle, int index, HCkStringBuilderW sb, const wchar_t *charset);
```

Provides the text data for the external reference at `index`. The `charset` specifies the byte representation of the text, such as `utf-8`, `utf-16`, `windows-1252`, etc. (If in doubt, try utf-8 first.)

Returns TRUE for success, FALSE for failure.

### XmlDSig.UseCertVault

`Chilkat 11.7.0 · wc · XmlDSig · UseCertVault · method · since 9.5.0.69`

```c
BOOL CkXmlDSigW_UseCertVault(HCkXmlDSigW cHandle, HCkXmlCertVaultW certVault);
```

Adds an XML certificate vault to the object's internal list of sources to be searched for certificates having public keys when verifying an XML signature. A single XML certificate vault may be used. If UseCertVault is called multiple times, only the last certificate vault will be used, as each call to UseCertVault will replace the certificate vault provided in previous calls.

Returns TRUE for success, FALSE for failure.

### XmlDSig.VerifyReferenceDigest

`Chilkat 11.7.0 · wc · XmlDSig · VerifyReferenceDigest · method · since 9.5.0.69`

```c
BOOL CkXmlDSigW_VerifyReferenceDigest(HCkXmlDSigW cHandle, int index);
```

This method allows for an application to verify the digest for each reference separately. This can be helpful if the full XMLDSIG validation fails, then one can test each referenced data's digest to see which, if any, fail to match.

See also:

- [Online Tool to Verify XML Signature](http://tools.chilkat.io/xmlDsigVerify.cshtml)

### XmlDSig.VerifySignature

`Chilkat 11.7.0 · wc · XmlDSig · VerifySignature · method · since 9.5.0.69`

```c
BOOL CkXmlDSigW_VerifySignature(HCkXmlDSigW cHandle, BOOL verifyReferenceDigests);
```

Verifies the signature indicated by the Selector property. If `verifyReferenceDigests` is `TRUE`, then the digest of each Reference within the signature's SignedInfo is also validated.

Returns TRUE for success, FALSE for failure.

See also:

- [Online Tool to Verify XML Signature](http://tools.chilkat.io/xmlDsigVerify.cshtml)

## Related classes

[`BinData`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/BinData.md), [`Http`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/Http.md), [`JsonObject`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/JsonObject.md), [`PublicKey`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/PublicKey.md), [`StringArray`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/StringArray.md), [`StringBuilder`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/StringBuilder.md), [`Xml`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/Xml.md), [`XmlCertVault`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/XmlCertVault.md)

