WS_GET_CERT_CALLBACK callback function (webservices.h)

Provides a certificate to the security runtime. This callback is specified as part of the WS_CUSTOM_CERT_CREDENTIAL, which in turn may be specified as part of a security binding that requires a certificate credential. The runtime will invoke this callback when the channel (client-side) or the listener (server-side) is opened.

Cert ownership: If this callback returns a success HRESULT, the caller (namely, the security runtime) will take ownership of the returned certificate, and will free it when the containing channel no longer needs it. If this callback returns a failure HRESULT, the caller will NOT take ownership of, or even look at, the value returned in the out parameter 'cert'.

Syntax

WS_GET_CERT_CALLBACK WsGetCertCallback;

HRESULT WsGetCertCallback(
  [in]           void *getCertCallbackState,
  [in, optional] const WS_ENDPOINT_ADDRESS *targetAddress,
  [in, optional] const WS_STRING *viaUri,
                 const _CERT_CONTEXT **cert,
  [in, optional] WS_ERROR *error
)
{...}

Parameters

[in] getCertCallbackState

State that was specified along with this callback in the certificate credential.

[in, optional] targetAddress

The target address to whom this certificate is to be presented, in case this certificate credential is specified for a client.

[in, optional] viaUri

The via address to whom this certificate is to be presented.

cert

The location to return the certificate.

[in, optional] error

Specifies where additional error information should be stored if the function fails.

Return value

This callback function does not return a value.

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 webservices.h