CryptMsgOpenToDecode / CryptMsgUpdate需要密码?

时间:2012-02-24 17:14:02

标签: winapi encryption cryptography public-key-encryption mapi

我正在使用CryptMsgOpenToDecode / CryptMsgUpdate读取加密消息(p7m文件)。除非需要密码,否则这种方法运行得相当好 - 在这种情况下,CryptMsgUpdate会返回成功,但会输出0字节。我该怎么办才能处理这种情况?

谢谢!

1 个答案:

答案 0 :(得分:3)

如果您使用Low-level Message FunctionsCryptMsgXXX个函数)来解码加密邮件,则必须使用CryptMsgControl CMSG_CTRL_DECRYPT并使many additional steps成为{ {1}}。请参阅here相应代码的示例。或者,您可以使用Simplified Message Functions,这使代码更容易。