In the macos system, when using the openssl cms command, the following error occurs, how to solve this problem.

openssl cms -decrypt -inform PEM -in privateKey.p7m -inkey privateKeyP7m.key -out privateKey.der
openssl:Error: 'cms' is an invalid command.

The openssl version is as follows:

openssl version
LibreSSL 2.8.3

1 Answer 1


macOS ventura is shipping with LibreSSL 3.3.6 which supports the cms command. To use cms on older versions of macOS you need to install a more modern OpenSSL or LibreSSL compared to what is provided by Apple. MacPorts or Homebrew can help you with this.

  • Reinstalled openssl3.0 on the mac, but when obtaining the version of openssl, it is still LibreSSL 2.8.3. I don't know why
    – Miah Luo
    Commented May 18, 2023 at 8:41
  • @MiahLuo: Likely you have installed openssl3 in some other place (like /usr/local/bin) but don't have this other place in your PATH and don't call the binary with an explicit path. But this kind of problems of properly installing and calling some software is no longer an Information Security problem but more for superuser.com. Commented May 18, 2023 at 9:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .