Please help with creating an electronic signature to the API request in PHP. I have an electronic signature generation command in openssl:
openssl cms -noattr -sign -binary -nosmimecap -no certs -signed my.crt -key my.key -outform der -in digest.txt -out digest.sign
Detailed description of the command:
# Basic command signature generation via openssl
`openssl cms -sign \`
# Electronic signature certificate, key, digest
`-signer my.crt -key my.key -outform der -in digest.txt -out digest.sign \`
# Removes attributes such as signing time and content type from inclusion
`--no matter \`
# Removes attributes such as the list of supported algorithms from inclusion
`-nosmimecap \`
# Removes line breaks of CR and LF
`-binary format from inclusion \`
# Removes the signer's certificate from inclusion
`-nocerts`
I looked through the documentation on OpenSSL functions in PHP, but I didn't understand how I could implement similar functionality using PHP. It is necessary to save the received value to a variable for subsequent sending as a POST request parameter
Tried using the openssl_cms_sign command, but I'm not sure if that's what I need