X509Certificate.GetCertHash Yöntem

Tanım

Bir X509Certificate nesnenin karma değerini döndürür.

Aşırı Yüklemeler

GetCertHash()

X.509v3 sertifikasının karma değerini bayt dizisi olarak döndürür.

GetCertHash(HashAlgorithmName)

Belirtilen şifreleme karma algoritması kullanılarak hesaplanan X.509v3 sertifikasının karma değerini döndürür.

GetCertHash()

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

X.509v3 sertifikasının karma değerini bayt dizisi olarak döndürür.

public:
 virtual cli::array <System::Byte> ^ GetCertHash();
public virtual byte[] GetCertHash ();
abstract member GetCertHash : unit -> byte[]
override this.GetCertHash : unit -> byte[]
Public Overridable Function GetCertHash () As Byte()

Döndürülenler

Byte[]

X.509 sertifikasının karma değeri.

Örnekler

Aşağıdaki örnek, bir bayt dizisini GetCertHash X.509 sertifikasının karma değeriyle doldurmak için yöntemini kullanır.

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.
   array<Byte>^results = cert->GetCertHash();
}

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.
        byte[] results = cert.GetCertHash();
    }
}
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 Byte() = cert.GetCertHash()
   End Sub 
End Class

Şunlara uygulanır

GetCertHash(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 döndürür.

public:
 virtual cli::array <System::Byte> ^ GetCertHash(System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public virtual byte[] GetCertHash (System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
abstract member GetCertHash : System.Security.Cryptography.HashAlgorithmName -> byte[]
override this.GetCertHash : System.Security.Cryptography.HashAlgorithmName -> byte[]
Public Overridable Function GetCertHash (hashAlgorithm As HashAlgorithmName) As Byte()

Parametreler

hashAlgorithm
HashAlgorithmName

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

Döndürülenler

Byte[]

X.509 sertifikasının karma değerini içeren bir bayt dizisi.

Özel durumlar

hashAlgorithm.Name veya null boş bir dizedir.

hashAlgorithm bilinen bir karma algoritması değildir.

Ayrıca bkz.

Şunlara uygulanır