X509Certificate.GetCertHash Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Retourneert de hash-waarde voor een X509Certificate object.
Overloads
| Name | Description |
|---|---|
| GetCertHash() |
Retourneert de hash-waarde voor het X.509v3-certificaat als een matrix van bytes. |
| GetCertHash(HashAlgorithmName) |
Retourneert de hash-waarde voor het X.509v3-certificaat dat wordt berekend met behulp van het opgegeven cryptografische hash-algoritme. |
GetCertHash()
- Bron:
- X509Certificate.cs
- Bron:
- X509Certificate.cs
- Bron:
- X509Certificate.cs
- Bron:
- X509Certificate.cs
- Bron:
- X509Certificate.cs
Retourneert de hash-waarde voor het X.509v3-certificaat als een matrix van bytes.
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()
Retouren
De hash-waarde voor het X.509-certificaat.
Voorbeelden
In het volgende voorbeeld wordt de GetCertHash methode gebruikt om een matrix van bytes te vullen met de hash-waarde voor een X.509-certificaat.
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
Van toepassing op
GetCertHash(HashAlgorithmName)
- Bron:
- X509Certificate.cs
- Bron:
- X509Certificate.cs
- Bron:
- X509Certificate.cs
- Bron:
- X509Certificate.cs
- Bron:
- X509Certificate.cs
Retourneert de hash-waarde voor het X.509v3-certificaat dat wordt berekend met behulp van het opgegeven cryptografische hash-algoritme.
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()
Parameters
- hashAlgorithm
- HashAlgorithmName
De naam van het cryptografische hash-algoritme dat moet worden gebruikt.
Retouren
Een bytematrix die de hash-waarde voor het X.509-certificaat bevat.
Uitzonderingen
hashAlgorithm.Name is null of een lege tekenreeks.
hashAlgorithm is geen bekend hash-algoritme.