AsymmetricSecurityKey.GetAsymmetricAlgorithm(String, Boolean) 方法
定义
在派生类中重写时,获取指定的非对称加密算法。When overridden in a derived class, gets the specified asymmetric cryptographic algorithm.
public:
abstract System::Security::Cryptography::AsymmetricAlgorithm ^ GetAsymmetricAlgorithm(System::String ^ algorithm, bool privateKey);
public abstract System.Security.Cryptography.AsymmetricAlgorithm GetAsymmetricAlgorithm (string algorithm, bool privateKey);
abstract member GetAsymmetricAlgorithm : string * bool -> System.Security.Cryptography.AsymmetricAlgorithm
Public MustOverride Function GetAsymmetricAlgorithm (algorithm As String, privateKey As Boolean) As AsymmetricAlgorithm
参数
- algorithm
- String
要创建的非对称算法。The asymmetric algorithm to create.
- privateKey
- Boolean
如果需要使用私钥来创建算法,则为 true;否则为 false。true when a private key is required to create the algorithm; otherwise, false.
返回
一个 AsymmetricAlgorithm,表示指定的非对称加密算法。An AsymmetricAlgorithm that represents the specified asymmetric cryptographic algorithm.
通常将 true 传递到 privateKey 参数中,因为解密通常需要使用私钥。Typically, true is passed into the privateKey parameter, as a private key is typically required for decryption.
注解
使用 SecurityAlgorithms 类的静态字段指定算法。Use the static fields of the SecurityAlgorithms class to specify the algorithm.