CryptoSys PKI Pro Manual

Base64 and PEM string alternatives for CMS objects

[New in v3.5] All functions that read a signed-data or enveloped-data CMS object will now accept the data in the szFileIn parameter in five forms.

1. Specify a filename
The file may contain data in one of three formats
  1. BER-encoded binary data
  2. PEM-encoded data (a PEM file)
  3. Base64-encoded data
2. Pass the data in a string
The string may contain data in one of two formats
  1. PEM-encoded data (a PEM string)
  2. Base64-encoded data

PEM format is base64-encoded data encapsulated inside "-----BEGIN FOO-----" and "-----END FOO-----" boundaries. See PEM string above. For example,

-----BEGIN PKCS7-----
MIAGCSqGSIb3DQEHAqCAMIACAQExADCABgkqhkiG9w0BBwGggCSABARUaGlzBBggaXMgc29
tZSBzYW1wbGUgY29udGVudC4AAAAAAAAxDjAMAgEBMAAwADAABAH9AAAAAAAA
-----END PKCS7-----

These filename-or-string forms are detected automatically and there is no longer any need [as of v3.5] to use the PKI_CMS_FORMAT_BASE64 option flag. One possible conflict could be if you are in the habit of naming files in the form "MAQwAgUA" without any "." extension and pass a string that corresponds to an existing file in the current directory. In that unlikely event, we will use the file.

However, if you use the PKI_BIG_FILE option, you must pass the filename of a BER-encoded binary file.

[Contents] [Index]

[PREV: PEM string alternative for X.509 certificates, RSA and EC keys, etc...]   [Contents]   [Index]   
   [NEXT: Specifying the algorithm, mode and padding for generic block cipher functions...]

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