SignHash

Pads and signs a buffer that contains a hash using Public-Key Cryptography Standards (PKCS1).

HRESULT
__stdcall SignHash(
                       __in PINFORMATIONCARD_CRYPTO_HANDLE  hCrypto,
                       __in DWORD                    cbHash,
                       __in_bcount( cbHash ) PBYTE   pHash,
                       __in LPCWSTR                  hashAlgOid,
                       __out DWORD*                  pcbSig,
                       __out_bcount( *pcbSig ) PBYTE* ppSig );

Parameters

Parameter Description

hCrypto

Handle to the cryptography object associated with a previously released security token.

cbHash

The length, in bytes, for both the input and output buffers.

pHash

The data to be decrypted.

hashAlgOid

The string OID that identifies the hash algorithm used to produce the data to be decrypted in pHash. The supported values for hashAlgOid are the OIDs for MD5 or SHA1.

pcbSig

The length of the returned signature.

ppSig

A pointer to a buffer that contains the returned signature. When you have finished using this pointer, free the memory by using the Win32 GlobalFree function.

Property Value/Return Value

HRESULT: If any of the parameters are NULL or 0, E_INVALIDARG is returned.

Requirements

Windows Vista

Header: Declared in infocard.h.

Library: Use infocardapi.lib.

See Also

Reference

Decrypt
Encrypt

Concepts

HRESULTS Returned

Copyright © 2007 by Microsoft Corporation. All rights reserved.