0

I am building a .NET software that must be integrated with a system that accept signed and encrypted files.

The other party provided one .P12 file for signing and one .PEM file for encrypting.

The other party also provided me an example procedure with openssl commands.

First of all, they tell me that I should create PEM file from the P12 file:

openssl pkcs12 –in SIGN.P12 –out SIGN.PEM

I picked up a random password MYPASS

Then I should use those PEM files in order to sign my original file:

openssl smime -sign -in INPUT.xml -signer SIGN.PEM -passin pass:MYPASS -outform der -binary -nodetach -out SIGNED.P7M

Next step is to encrypt the signed file:

openssl smime -encrypt –in SIGNED.P7M –outform der –binary –des3 -out ENCRYPTED.ENC OTHERPARTYCERTIFICATE.PEM

The question is: how to achieve this using just Chilkat.NET library?

Genesio
  • 171
  • 2
  • 13

1 Answers1

0

Here is an example for creating the signature:

https://www.example-code.com/csharp/openssl_sign_outform_der.asp

Here is the example to encrypt:

https://www.example-code.com/csharp/openssl_encrypt_signed_file.asp


Here is the same signing example in different programming languages: (The encrypt example is also available in all programming languages on example-code.com)

Calaf
  • 1,133
  • 2
  • 9
  • 22
Chilkat Software
  • 1,405
  • 1
  • 9
  • 8