大网数据广告活动
账户与安全

Decrypting Data

· 52CE 我爱测

Presents the steps to decrypt an encrypted message.

This section presents the steps to decrypt an encrypted message.

To decrypt an encrypted message

  1. Get a pointer to the digitally enveloped message.
  2. Open a certificate store.
  3. From the message, retrieve the recipient identifier (My ID).
  4. Use the recipient identifier to retrieve the certificate.
  5. Get the private key for the certificate.
  6. Use the private key to decrypt the symmetric (session) key.
  7. Retrieve the encryption algorithm from the message.
  8. Using the decrypted session key and the encryption algorithm, decrypt the data.

CryptDecryptMessage does all of the tasks for decrypting a message; however, initialization of structures and other data is still necessary.

To decrypt data using CryptDecryptMessage

  1. Get a pointer to the encrypted BLOB.
  2. Open a certificate store.
  3. Create a certificate store array.
  4. Initialize the CRYPT_DECRYPT_MESSAGE_PARA structure.
  5. Call CryptDecryptMessage to decrypt the data contained in the message.

Example C Program: Using CryptEncryptMessage and CryptDecryptMessage implements the procedure just presented. Comments show which code elements accomplish each step in the procedure. For details about the function, see CryptDecryptMessage, and for details about the data structure, see CRYPT_DECRYPT_MESSAGE_PARA.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。