CryptoSys PKI Toolkit 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 strFileIn parameter in five forms.

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

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.

[Contents] [Index]

[HOME]   [NEXT: Specifying the algorithm and mode for generic block cipher functions...]

Copyright © 2004-10 D.I. Management Services Pty Ltd. All rights reserved.