本文介绍了创建加密的可插拔基础结构(如Java中的JCE)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<!-/*字体定义*/@ font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:变量; mso-font-signature:0 0 0 0 0 0;} @ font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:变量; mso-font-signature:-520092929 1073786111 9 0 415 0;}/*样式定义*/p.MsoNormal,li.MsoNormal,div.MsoNormal {mso-style-unhide:no; mso-style-qformat:是; mso-style-parent:"; margin-top:0in; margin-right:0in;底边距:10.0pt; margin-left:0in;线高:115%; mso分页:寡妇孤儿;字体大小:11.0pt;字体家族:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}.MsoChpDefault {mso-style-type:only-export; mso-default-props:是; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:时代" 新罗马书》; mso-bidi-theme-font:minor-bidi;}.MsoPapDefault {mso-style-type:仅导出;底边距:10.0pt; line-height:115%;} @page WordSection1 {size:8.5in 11.0in;边距:1.0英寸1.0英寸1.0英寸1.0英寸; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.WordSection1 {page:WordSection1;}->

<!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-520092929 1073786111 9 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin-top:0in; margin-right:0in; margin-bottom:10.0pt; margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} .MsoPapDefault {mso-style-type:export-only; margin-bottom:10.0pt; line-height:115%;} @page WordSection1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.WordSection1 {page:WordSection1;} -->

Hi,

我正在寻找Java中的类似JCE的基础架构,因此我可以安装"加密提供程序.

I am looking for an infrastructure like JCE in java so I can “install” encryption providers.

我现在要输入的是Bouncy Castle提供程序,并使用"PBEWITHMD5AND256BITAES-CBC-OPENSSL"但是我希望能够仅通过配置更改来更改提供程序和算法.我在Java中使用JCE.

The one I am going to put in now is Bouncy Castle provider and use “PBEWITHMD5AND256BITAES-CBC-OPENSSL” but I want to be able to change the providers and algorithms just by configuration change. I have that in Java with JCE.

C#中是否有类似的东西,并且有文档/示例吗?

Is there something like that in C# and are there docs / examples?

 

谢谢.

推荐答案

嗨:

我们在.Net中具有System.Security.Cryptography命名空间,可以从C#应用程序中使用它,并且提供诸如CspParameters之类的类来指定使用构造函数重载的CSP.

CspParameters类具有一个名为CspParameters.ProviderType的字段,该字段表示CspParameters的提供程序类型代码.请参阅 http://msdn.microsoft.com/zh-cn/library/system.security.cryptography.cspparameters.providertype.aspx .

使用ProviderType字段可通过传递表示该提供者的数值来指定提供者类型.代表默认提供程序类型的数值在WinCrypt.h头文件中定义:

1.要指定与RSA类兼容的提供程序,请传递值1.
2.要指定与DSA类兼容的提供程序,请传递值13.

有关算法,请参考 http://msdn.microsoft.com/en-us/library/system.security.cryptography.cspparameters.aspx .我不确定,但是您可能要使用AssymetricAlgorithm或SymmetricAlgorithm.

参考:
http://msdn.microsoft.com/zh-CN /library/9eat8fht.aspx

We have the System.Security.Cryptography namespace in .Net that could be used from a C# application and it provides classes such as CspParameters to specify a CSP using an overload of the constructor.

The CspParameters class has a field called CspParameters.ProviderType that represents the provider type code for CspParameters. Please refer tohttp://msdn.microsoft.com/en-us/library/system.security.cryptography.cspparameters.providertype.aspx.

Use the ProviderType field to specify a provider type by passing a numeric value that represents that provider. The numeric values that represent the default provider types are defined in the WinCrypt.h header file:

1. To specify a provider compatible with the RSA class, pass a value of 1.
2. To specify a provider compatible with the DSA class, pass a value of 13.

For algorithms please refer to http://msdn.microsoft.com/en-us/library/system.security.cryptography.cspparameters.aspx. I am not sure but you may want to use AssymetricAlgorithm or SymmetricAlgorithm.

Reference:
http://msdn.microsoft.com/en-us/library/9eat8fht.aspx

有帮助吗?

Wendell

Wendell


这篇关于创建加密的可插拔基础结构(如Java中的JCE)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 18:17