我正在使用CryptMsgOpenToDecode / CryptMsgUpdate读取加密消息(p7m文件)。除非需要密码,否则这种方法运行得相当好 - 在这种情况下,CryptMsgUpdate会返回成功,但会输出0字节。我该怎么办才能处理这种情况?
谢谢!
答案 0 :(得分:3)
如果您使用Low-level Message Functions(CryptMsgXXX
个函数)来解码加密邮件,则必须使用CryptMsgControl
CMSG_CTRL_DECRYPT
并使many additional steps成为{ {1}}。请参阅here相应代码的示例。或者,您可以使用Simplified Message Functions,这使代码更容易。