We developed an application that reads a CMS encoded PEM file with this command:
$ openssl cms -verify -in filepath -inform PEM -noverify
The file is digitally signed, but we don't care about it, as we only want to extract the contents inside (it starts with: -----BEGIN CMS-----
and has a ".pem" extension). That is working like a charm.
Now, we need to write an acceptance tests for this app.. but we cannot use the production handled CMS files so we want to encode a custom file to use as "test input".
As far as my understanding is, we simply need to genearate a CMS encoded file from an input file that 1) is not encrypted and 2) it could or not be digitally signed (but as far as I understand is not a must of CMS).
No matter wich parameters we call openssl with, we cannot get it this work. This is more or less what we are trying (with all the -nosigs -noverify -nocerts -noattr -nodetach
combinations):
$ openssl cms -in input.xml -outform PEM -cmsout -out output.pem
Any ideas? Thanks