次の方法で共有


MakeSignature (Compact 2013)

3/28/2014

This function generates a cryptographic checksum of the message and includes sequencing information to prevent message loss or insertion. The function allows the application to choose between several cryptographic algorithms, if supported by the chosen mechanism.

Syntax

SECURITY_STATUS SEC_ENTRY MakeSignature( 
  PCtxtHandle phContext, 
  ULONG fQOP, 
  PSecBufferDesc pMessage, 
  ULONG MessageSeqNo 
);

Parameters

  • phContext
    [in] Pointer to a CtxtHandle structure identifying the context handle. For information on CtxtHandle, see SSPI Handles.
  • fQOP
    [in] Package-specific flags that indicate the quality of protection. A security package can use this parameter to enable the selection of cryptographic algorithms.
  • pMessage
    [in, out] Pointer to a SecBufferDesc structure. On input, the structure references one or more SecBuffer structures that contain the message to be signed. The function does not process buffers with the SECBUFFER_READONLY attribute.

    The SecBufferDesc structure also references a SecBuffer structure of type SECBUFFER_TOKEN that receives the signature.

  • MessageSeqNo
    [in] A message sequence number that the transport application assigned to the message. If the transport application does not maintain sequence numbers, this parameter is zero.

Return Value

Returns SEC_E_OK to indicate success. The function returns a nonzero error value to indicate failure.

Remarks

This function generates a signature that is based on the message and the session key for the context.

If the transport application has created the security context to support sequence detection and provides a sequence number to this function, this information is included in the signature. The context protects against the reply, insertion, and suppression of messages. The security package will incorporate the sequence number passed from the transport application.

Requirements

Header

security.h,
sspi.h

Library

secur32.lib

See Also

Reference

Authentication Services Functions
VerifySignature
SecBuffer
SecBufferDesc