This topic has not yet been rated - Rate this topic

ContentInfo Constructor (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.

Namespace:  System.Security.Cryptography.Pkcs
Assembly:  System.Security (in System.Security.dll)
public ContentInfo(
	Oid contentType,
	byte[] content
)

Parameters

contentType
Type: System.Security.Cryptography.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
Type: System.Byte[]
An array of byte values that represents the data from which to create the ContentInfo object.
Exception Condition
ArgumentNullException

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

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

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ