ContentInfo Constructors

Definition

Creates an instance of the ContentInfo class.

Overloads

ContentInfo(Byte[])

The ContentInfo(Byte[]) constructor creates an instance of the ContentInfo class by using an array of byte values as the data and a default object identifier (OID) that represents the content type.

ContentInfo(Oid, Byte[])

The ContentInfo(Oid, Byte[]) constructor creates an instance of the ContentInfo class by using the specified content type and an array of byte values as the data.

ContentInfo(Byte[])

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

The ContentInfo(Byte[]) constructor creates an instance of the ContentInfo class by using an array of byte values as the data and a default object identifier (OID) that represents the content type.

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())

Parameters

content
Byte[]

An array of byte values that represents the data from which to create the ContentInfo object.

Exceptions

A null reference was passed to a method that does not accept it as a valid argument.

Remarks

The ContentInfo class has the following default property values.

Property Default value
ContentType 1.2.840.113549.1.7.1 (data)

Applies to

ContentInfo(Oid, Byte[])

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

The ContentInfo(Oid, Byte[]) constructor creates an instance of the ContentInfo class by using the specified content type and an array of byte values as the data.

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())

Parameters

contentType
Oid

An Oid object that contains an object identifier (OID) that specifies the content type of the content. This can be data, digestedData, encryptedData, envelopedData, hashedData, signedAndEnvelopedData, or signedData. For more information, see Remarks.

content
Byte[]

An array of byte values that represents the data from which to create the ContentInfo object.

Exceptions

A null reference was passed to a method that does not accept it as a valid argument.

Remarks

The digestedData and encryptedData content types, which appear in the CMS/PKCS #7 standards document, are not content types that can be produced by this implementation. However these content types can be passed to this constructor.

Use the following OID strings as arguments to the ContentInfo(Oid, Byte[]) constructor to build the contentType content type parameter.

contentType content type OID string
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

Applies to