问题描述
我正在使用CNG和cryptoAPI生成rawsignature和证书字节数组
Hi, i am having rawsignature and certificate byte array generated using CNG and cryptoAPI
现在我想创建一个ASN1 Encoded对象,其中包含一些类似内容类型的数据,签名时间,消息摘要和八位字符串。
Now i want to create an ASN1 Encoded object with some oid's like content type,data, signing time, message digest and octect string.
谁能告诉我在cryptoAPI或CNG中是否有任何ASN1编码类API?或者怎么做?
Can anyone tell me is there any ASN1 Encoded class API in cryptoAPI or CNG? or how to do this?
我试图在
System.Security.Cryptography 但未成功。
I tried to use AsnEncodedData Class at System.Security.Cryptography but not succeded.
提前致谢。
推荐答案
CryptoAPI无法对任意对象执行ASN1编码。它只是 知道如何编码某些加密中使用的特定数据结构 操作 - 例如各种PKCS标准中规定的那些。见  CryptEncodeObject。
CryptoAPI can't perform ASN1 encoding of arbitrary objects. It only knows how to encode specific data structures used in certain crypto operations - e.g. those specified in various PKCS standards. See CryptEncodeObject.
如果要创建PKCS消息,请参阅
If you want to create a PKCS message, see
http://msdn.microsoft.com/en-us/library/windows/desktop/aa387404.aspx
我不熟悉CNG。
这篇关于如何创建ASN1编码对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!