我正在构建.NET软件,该软件必须与接受签名和加密文件的系统集成。
另一方提供了一个用于签名的.P12文件和一个用于加密的.PEM文件。
另一方也为我提供了一个带有openssl命令的示例过程。
首先,他们告诉我应该从P12文件创建PEM文件:
openssl pkcs12 –in SIGN.P12 –out SIGN.PEM
我选择了随机密码MYPASS
然后我应该使用那些PEM文件来对我的原始文件进行签名:
openssl smime -sign -in INPUT.xml -signer SIGN.PEM -passin pass:MYPASS -outform der -binary -nodetach -out SIGNED.P7M
下一步是加密签名文件:
openssl smime -encrypt –in SIGNED.P7M –outform der –binary –des3 -out ENCRYPTED.ENC OTHERPARTYCERTIFICATE.PEM
问题是:如何仅使用Chilkat.NET库来实现这一目标?
答案 0 :(得分:0)
以下是创建签名的示例:
https://www.example-code.com/csharp/openssl_sign_outform_der.asp
以下是要加密的示例:
https://www.example-code.com/csharp/openssl_encrypt_signed_file.asp
以下是使用不同编程语言的相同签名示例: (在example-code.com上,所有示例语言也都提供了加密示例)
经典ASP:https://www.example-code.com/asp/openssl_sign_outform_der.asp
C:https://www.example-code.com/C/openssl_sign_outform_der.asp
Chilkat2-Python:https://www.example-code.com/chilkat2-python/openssl_sign_outform_der.asp
C ++:https://www.example-code.com/cpp/openssl_sign_outform_der.asp
C#:https://www.example-code.com/csharp/openssl_sign_outform_der.asp
DataFlex:https://www.example-code.com/dataflex/openssl_sign_outform_der.asp
Delphi ActiveX:https://www.example-code.com/delphiAx/openssl_sign_outform_der.asp
Delphi DLL:https://www.example-code.com/delphiDll/openssl_sign_outform_der.asp
Excel:https://www.example-code.com/excel/openssl_sign_outform_der.asp
Visual FoxPro:https://www.example-code.com/foxpro/openssl_sign_outform_der.asp
Java:https://www.example-code.com/java/openssl_sign_outform_der.asp
Node.js:https://www.example-code.com/nodejs/openssl_sign_outform_der.asp
Objective-C:https://www.example-code.com/objc/openssl_sign_outform_der.asp
Perl:https://www.example-code.com/perl/openssl_sign_outform_der.asp
PHP ActiveX:https://www.example-code.com/phpAx/openssl_sign_outform_der.asp
PHP扩展名:https://www.example-code.com/phpExt/openssl_sign_outform_der.asp
PowerBuilder:https://www.example-code.com/powerbuilder/openssl_sign_outform_der.asp
PowerShell:https://www.example-code.com/powershell/openssl_sign_outform_der.asp
PureBasic:https://www.example-code.com/purebasic/openssl_sign_outform_der.asp
CkPython:https://www.example-code.com/python/openssl_sign_outform_der.asp
Ruby:https://www.example-code.com/ruby/openssl_sign_outform_der.asp
SQL Server:https://www.example-code.com/sql/openssl_sign_outform_der.asp
迅速2:https://www.example-code.com/swift/openssl_sign_outform_der.asp
迅速3/4:https://www.example-code.com/swift3/openssl_sign_outform_der.asp
Tcl:https://www.example-code.com/tcl/openssl_sign_outform_der.asp
Unicode C:https://www.example-code.com/unicodeC/openssl_sign_outform_der.asp
Unicode C ++:https://www.example-code.com/unicodeCpp/openssl_sign_outform_der.asp
Visual Basic 6.0:https://www.example-code.com/vb6/openssl_sign_outform_der.asp
VB.NET:https://www.example-code.com/vbnet/openssl_sign_outform_der.asp
VBScript:https://www.example-code.com/vbscript/openssl_sign_outform_der.asp
Xojo插件:https://www.example-code.com/xojo/openssl_sign_outform_der.asp