Share via


Encrypt

Encrypts a data buffer using the key associated with the cryptography object.

HRESULT
__stdcall Encrypt(
                      __in PINFORMATIONCARD_CRYPTO_HANDLE hCrypto,
                      __in BOOL fOAEP,
                      __in DWORD cbInData,
                      __in_bcount( cbInData ) PBYTE pInData,
                      __out DWORD *pcbOutData,
                      __out_bcount( *pcbOutData ) PBYTE* ppOutData );

Parameters

Parameter Description

hCrypto

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

fOAEP

If false, Public-Key Cryptography Standards (PKCS1) v1.5 padding is added to the data before encryption. If true, PKCS1 v2 padding is added to the data before encryption.

cbInData

The length, in bytes, of the input buffer.

pInData

The data to be encrypted.

pcbOutData

The length, in bytes, of the output buffer.

ppOutData

The output buffer in which to put the encrypted data.

Property Value/Return Value

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

Requirements

Windows Vista

Header: Declared in infocard.h.

Library: Use infocardapi.lib.

See Also

Reference

Decrypt

Concepts

HRESULTS Returned

Copyright © 2007 by Microsoft Corporation. All rights reserved.