Create a CMS SignedData structure

I’m trying to generate a signedData CMS message to communicate with a Web Service. I have the certificate in a file and the private key.
Is it possible to achieve this using Crypto class?

Thanks a lot.

Signed with what?

Sorry, I was out. What I’m trying to do is sign a XML file with a certificate (pfx) and the private key to generate a encrypted file for exchange with a Web Service.

I could do it with openssl command in shell but I think it would be better doing all by xojo.

Syntax in OpenSSL:
openssl cms -sign -in data.xml -nodetach -inkey private.key -signer cert.crt -out result.cms -outform PEM

ref:
https://www.openssl.org/docs/manmaster/man1/openssl-cms.html
https://www.cryptosys.net/pki/manpki/pki_signeddata.html

Check the SignData method in OpenSSLMBS module.

Thanks Christian.
So, it’s not possible to do it with Crypto class, is it?

Maybe, depends on what you need:
http://documentation.xojo.com/api/cryptography/crypto.html#crypto-rsasign

Yes, I’ve read so many times but it has no parameters for the certificate, only for the key