CmsReadEnvDataToBytes Method |
Read and decrypt a CMS enveloped-data object to a byte array.
Namespace: CryptoSysPKIAssembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.30549 (23.1.0.0)
Syntaxpublic static byte[] ReadEnvDataToBytes(
string inputFile,
string x509File,
string privateKey
)
Public Shared Function ReadEnvDataToBytes (
inputFile As String,
x509File As String,
privateKey As String
) As Byte()
Parameters
- inputFile String
- Name of file containing CMS enveloped-data object (binary or base64-encoded) or the data as a base64 or PEM string.
- x509File String
- (optional) filename of the recipient's X.509 certificate.
- privateKey String
- Internal representation of private key.
Return Value
ByteDecrypted content in a byte array, or empty array on error.
Example
byte[] b = Cms.ReadEnvDataToBytes(inputFile, "", privateKey);
string s = System.Text.Encoding.UTF8.GetString(b);
See Also