ContentInfo 构造函数

定义

创建 ContentInfo 类的实例。

重载

ContentInfo(Byte[])

ContentInfo(Byte[]) 构造函数通过使用作为数据的字节值数组和表示内容类型的默认 object identifier (OID) 来创建 ContentInfo 类的实例。

ContentInfo(Oid, Byte[])

ContentInfo(Oid, Byte[]) 构造函数通过使用指定的内容类型和用作数据的字节值数组来创建 ContentInfo 类的实例。

ContentInfo(Byte[])

ContentInfo(Byte[]) 构造函数通过使用作为数据的字节值数组和表示内容类型的默认 object identifier (OID) 来创建 ContentInfo 类的实例。

public:
 ContentInfo(cli::array <System::Byte> ^ content);
public ContentInfo (byte[] content);
new System.Security.Cryptography.Pkcs.ContentInfo : byte[] -> System.Security.Cryptography.Pkcs.ContentInfo
Public Sub New (content As Byte())

参数

content
Byte[]

一个表示数据的字节值数组,要从这些数据创建 ContentInfo 对象。

例外

向不接受空引用作为有效参数的方法传递了一个空引用。

注解

ContentInfo 类具有以下默认属性值。

Property 默认值
ContentType 1.2.840.113549.1.7.1 (数据)

适用于

ContentInfo(Oid, Byte[])

ContentInfo(Oid, Byte[]) 构造函数通过使用指定的内容类型和用作数据的字节值数组来创建 ContentInfo 类的实例。

public:
 ContentInfo(System::Security::Cryptography::Oid ^ contentType, cli::array <System::Byte> ^ content);
public ContentInfo (System.Security.Cryptography.Oid contentType, byte[] content);
new System.Security.Cryptography.Pkcs.ContentInfo : System.Security.Cryptography.Oid * byte[] -> System.Security.Cryptography.Pkcs.ContentInfo
Public Sub New (contentType As Oid, content As Byte())

参数

contentType
Oid

一个 Oid 对象,该对象包含指定内容类型的 object identifier (OID)。 可以是 data、digestedData、encryptedData、envelopedData、hashedData、signedAndEnvelopedData 或 signedData。 有关更多信息,请参阅“备注”。

content
Byte[]

一个表示数据的字节值数组,要从这些数据创建 ContentInfo 对象。

例外

向不接受空引用作为有效参数的方法传递了一个空引用。

注解

在 CMS/PKCS #7 标准文档中显示的 digestedData 和 encryptedData 内容类型不是此实现可以生成的内容类型。 但是,这些内容类型可以传递给此构造函数。

使用以下 OID 字符串作为 ContentInfo(Oid, Byte[]) 构造函数的参数来生成 contentType 内容类型参数。

contentType 内容类型 OID 字符串
data 1.2.840.113549.1.7.1
digestedData 1.2.840.113549.1.7.5
encryptedData 1.2.840.113549.1.7.6
envelopedData 1.2.840.113549.1.7.3
hashedData 1.2.840.113549.1.7.5
signedAndEnvelopedData 1.2.840.113549.1.7.4
signedData 1.2.840.113549.1.7.2

适用于