X509Certificate.GetCertHashString Yöntem

Tanım

X.509v3 sertifikasının karma değerini içeren onaltılık bir dize döndürür.

Aşırı Yüklemeler

GetCertHashString()

X.509v3 sertifikasının SHA1 karma değerini onaltılık dize olarak döndürür.

GetCertHashString(HashAlgorithmName)

Belirtilen şifreleme karma algoritması kullanılarak hesaplanan X.509v3 sertifikasının karma değerini içeren onaltılık bir dize döndürür.

GetCertHashString()

Kaynak:
X509Certificate.cs
Kaynak:
X509Certificate.cs
Kaynak:
X509Certificate.cs

X.509v3 sertifikasının SHA1 karma değerini onaltılık dize olarak döndürür.

public:
 virtual System::String ^ GetCertHashString();
public virtual string GetCertHashString ();
abstract member GetCertHashString : unit -> string
override this.GetCertHashString : unit -> string
Public Overridable Function GetCertHashString () As String

Döndürülenler

X.509 sertifika karma değerinin onaltılık dize gösterimi.

Örnekler

Aşağıdaki örnekte bir X.509 sertifika karması değeri almak, dizeye dönüştürmek ve konsolda görüntülemek için yöntemi kullanılır GetCertHashString .

using namespace System;
using namespace System::Security::Cryptography::X509Certificates;
int main()
{
   
   // The path to the certificate.
   String^ Certificate = "Certificate.cer";
   
   // Load the certificate into an X509Certificate object.
   X509Certificate^ cert = X509Certificate::CreateFromCertFile( Certificate );
   
   // Get the value.
   String^ results = cert->GetCertHashString();
   
   // Display the value to the console.
   Console::WriteLine( results );
}

using System;
using System.Security.Cryptography.X509Certificates;

public class X509
{

    public static void Main()
    {

        // The path to the certificate.
        string Certificate =  "Certificate.cer";

        // Load the certificate into an X509Certificate object.
        X509Certificate cert = X509Certificate.CreateFromCertFile(Certificate);

        // Get the value.
        string results = cert.GetCertHashString();

        // Display the value to the console.
        Console.WriteLine(results);
    }
}
Imports System.Security.Cryptography.X509Certificates

Public Class X509
   
   
   Public Shared Sub Main()
      
      ' The path to the certificate.
      Dim Certificate As String = "Certificate.cer"
      
      ' Load the certificate into an X509Certificate object.
      Dim cert As X509Certificate = X509Certificate.CreateFromCertFile(Certificate)
      
      ' Get the value.
      Dim results As String = cert.GetCertHashString()
      
      ' Display the value to the console.
      Console.WriteLine(results)
   End Sub 
End Class

Şunlara uygulanır

GetCertHashString(HashAlgorithmName)

Kaynak:
X509Certificate.cs
Kaynak:
X509Certificate.cs
Kaynak:
X509Certificate.cs

Belirtilen şifreleme karma algoritması kullanılarak hesaplanan X.509v3 sertifikasının karma değerini içeren onaltılık bir dize döndürür.

public:
 virtual System::String ^ GetCertHashString(System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public virtual string GetCertHashString (System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
abstract member GetCertHashString : System.Security.Cryptography.HashAlgorithmName -> string
override this.GetCertHashString : System.Security.Cryptography.HashAlgorithmName -> string
Public Overridable Function GetCertHashString (hashAlgorithm As HashAlgorithmName) As String

Parametreler

hashAlgorithm
HashAlgorithmName

Kullanılacak şifreleme karma algoritmasının adı.

Döndürülenler

X.509 sertifika karma değerinin onaltılık dize gösterimi.

Özel durumlar

hashAlgorithm.Name veya null boş bir dizedir.

hashAlgorithm bilinen bir karma algoritması değildir.

Şunlara uygulanır