CryptoSys PKI Pro Manual

Cms.ReadSigDataToBytes Method

Read the content from a CMS signed-data object directly into a byte array.

Syntax

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

Parameters

inputFile
Name of file containing CMS signed-data object (binary or base64-encoded) or the data as a base64 or PEM string.

Return Value

Byte array containing the content or a zero-length array if error.

Remarks

Use this if the content contains non-ASCII characters, e.g. UTF-8 encoded.

Example

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

See Also

VB6/C equivalent: CMS_ReadSigDataToBytes

[Contents] [Index]

[PREV: Cms.ReadEnvDataToString Method...]   [Contents]   [Index]   
   [NEXT: Cms.ReadSigDataToFile Method...]

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