CryptoSys PKI Pro Manual

Cms.ReadEnvDataToBytes Method

Read and decrypt a CMS enveloped-data object to a byte array.

Syntax

[C#]
public static byte[] ReadEnvDataToBytes(
	string inputFile,
	string x509File,
	string privateKey
)
[VB.NET]
Public Shared Function ReadEnvDataToBytes ( _
	inputFile As String, _
	x509File As String, _
	privateKey As String _
) As Byte()

Parameters

inputFile
Name of file containing CMS enveloped-data object (binary or base64-encoded) or the data as a base64 or PEM string.
x509File
(optional) filename of the recipient's X.509 certificate.
privateKey
Internal representation of private key.

Return Value

Decrypted content in a byte array, or empty array on error.

Example

[C#]
// Read in content to a byte array
byte[] b = Cms.ReadEnvDataToBytes(inputFile, "", privateKey);
// Convert to a .NET string (assuming UTF-8 encoded)
string s = System.Text.Encoding.UTF8.GetString(b);

See Also

VB6/C equivalent: CMS_ReadEnvDataToBytes

[Contents] [Index]

[PREV: Cms.ReadComprData Method...]   [Contents]   [Index]   
   [NEXT: Cms.ReadEnvDataToFile Method...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.