You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// <summary>The <c>CryptEncryptMessage</c> function encrypts and encodes a message.</summary>
943
+
/// <param name="pEncryptPara">
944
+
/// <para>A pointer to a CRYPT_ENCRYPT_MESSAGE_PARA structure that contains the encryption parameters.</para>
945
+
/// <para>
946
+
/// The <c>CryptEncryptMessage</c> function does not support the SHA2 OIDs, <c>szOID_DH_SINGLE_PASS_STDDH_SHA256_KDF</c> and <c>szOID_DH_SINGLE_PASS_STDDH_SHA384_KDF</c>.
947
+
/// </para>
948
+
/// </param>
949
+
/// <param name="cRecipientCert">Number of elements in the rgpRecipientCert array.</param>
950
+
/// <param name="rgpRecipientCert">
951
+
/// Array of pointers to CERT_CONTEXT structures that contain the certificates of intended recipients of the message.
952
+
/// </param>
953
+
/// <param name="pbToBeEncrypted">A pointer to a buffer that contains the message that is to be encrypted.</param>
954
+
/// <param name="cbToBeEncrypted">The size, in bytes, of the message that is to be encrypted.</param>
955
+
/// <param name="pbEncryptedBlob">
956
+
/// <para>A pointer to BLOB that contains a buffer that receives the encrypted and encoded message.</para>
957
+
/// <para>
958
+
/// To set the size of this information for memory allocation purposes, this parameter can be <c>NULL</c>. For more information, see
959
+
/// Retrieving Data of Unknown Length.
960
+
/// </para>
961
+
/// </param>
962
+
/// <param name="pcbEncryptedBlob">
963
+
/// <para>
964
+
/// A pointer to a <c>DWORD</c> that specifies the size, in bytes, of the buffer pointed to by the pbEncryptedBlob parameter. When
965
+
/// the function returns, this variable contains the size, in bytes, of the encrypted and encoded message copied to pbEncryptedBlob.
966
+
/// </para>
967
+
/// <para>
968
+
/// <c>Note</c> When processing the data returned in the buffer of the pbEncryptedBlob, applications need to use the actual size of
969
+
/// the data returned. The actual size can be slightly smaller than the size of the buffer specified on input. (On input, buffer
970
+
/// sizes are usually specified large enough to ensure that the largest possible output data will fit in the buffer.) On output, the
971
+
/// variable pointed to by this parameter is updated to reflect the actual size of the data copied to the buffer.
972
+
/// </para>
973
+
/// </param>
974
+
/// <returns>
975
+
/// <para>If the function succeeds, the function returns nonzero ( <c>TRUE</c>).</para>
976
+
/// <para>If the function fails, it returns zero ( <c>FALSE</c>). For extended error information, call GetLastError.</para>
977
+
/// <para>
978
+
/// <c>Note</c> Errors from calls to CryptGenKey, CryptEncrypt, CryptImportKey, and CryptExportKey can be propagated to this function.
979
+
/// </para>
980
+
/// <para>The GetLastError function returns the following error codes most often.</para>
981
+
/// <list type="table">
982
+
/// <listheader>
983
+
/// <term>Return code</term>
984
+
/// <term>Description</term>
985
+
/// </listheader>
986
+
/// <item>
987
+
/// <term>ERROR_MORE_DATA</term>
988
+
/// <term>
989
+
/// If the buffer specified by the pbEncryptedBlob parameter is not large enough to hold the returned data, the function sets the
990
+
/// ERROR_MORE_DATA code and stores the required buffer size, in bytes, in the variable pointed to by pcbEncryptedBlob.
991
+
/// </term>
992
+
/// </item>
993
+
/// <item>
994
+
/// <term>E_INVALIDARG</term>
995
+
/// <term>
996
+
/// The message encoding type is not valid. Currently only PKCS_7_ASN_ENCODING is supported. The cbSize in *pEncryptPara is not valid.
997
+
/// </term>
998
+
/// </item>
999
+
/// </list>
1000
+
/// <para>
1001
+
/// If the function fails, GetLastError may return an Abstract Syntax Notation One (ASN.1) encoding/decoding error. For information
1002
+
/// about these errors, see ASN.1 Encoding/Decoding Return Values.
0 commit comments