X509AsymmetricSecurityKey.GetAsymmetricAlgorithm(String, Boolean) Metoda

Definicja

Pobiera określony asymetryczny algorytm kryptograficzny.

public:
 override System::Security::Cryptography::AsymmetricAlgorithm ^ GetAsymmetricAlgorithm(System::String ^ algorithm, bool privateKey);
public override System.Security.Cryptography.AsymmetricAlgorithm GetAsymmetricAlgorithm (string algorithm, bool privateKey);
override this.GetAsymmetricAlgorithm : string * bool -> System.Security.Cryptography.AsymmetricAlgorithm
Public Overrides Function GetAsymmetricAlgorithm (algorithm As String, privateKey As Boolean) As AsymmetricAlgorithm

Parametry

algorithm
String

Algorytm asymetryczny do utworzenia.

privateKey
Boolean

true gdy klucz prywatny jest wymagany do utworzenia algorytmu; w przeciwnym razie , false.

Zwraca

Element AsymmetricAlgorithm reprezentujący określony asymetryczny algorytm kryptograficzny.

Wyjątki

privateKey jest true i certyfikat X.509 określony w konstruktorze nie ma klucza prywatnego.

-lub-

algorithm jest XmlDsigDSAUrl i klucz publiczny lub prywatny dla certyfikatu X.509 określonego w konstruktorze nie jest typu DSA.

-lub-

algorithmto XmlEncRSA15Url, XmlEncRSAOAEPUrlXmlDsigRSASHA1Url lub , a klucz publiczny lub RsaSha256Signature prywatny dla certyfikatu X.509 określonego w konstruktorze nie jest typu RSA.

-lub-

algorithm program nie jest obsługiwany. Obsługiwane algorytmy to XmlDsigDSAUrl, , XmlEncRSA15UrlXmlEncRSAOAEPUrl, XmlDsigRSASHA1Url, i RsaSha256Signature.

Uwagi

XmlDsigDSAUrlUżyj pól , XmlEncRSA15Url, XmlEncRSAOAEPUrlXmlDsigRSASHA1Url lub RsaSha256Signature , aby określić algorithm parametr .

Ze względu na problemy z kolizją z algorytmem SHA1 firma Microsoft zaleca model zabezpieczeń oparty na algorytmie SHA256 lub lepszym.

Dotyczy