Share via


ContentInfo 构造函数

定义

创建 ContentInfo 类的实例。

重载

ContentInfo(Byte[])

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

ContentInfo(Oid, Byte[])

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

ContentInfo(Byte[])

Source:
ContentInfo.cs
Source:
ContentInfo.cs
Source:
ContentInfo.cs
Source:
ContentInfo.cs

构造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[])

Source:
ContentInfo.cs
Source:
ContentInfo.cs
Source:
ContentInfo.cs
Source:
ContentInfo.cs

构造 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

一个 Oidobject 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

适用于