X509Certificate.GetCertHash Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Devolve o valor de hash de um X509Certificate objeto.
Sobrecargas
| Name | Description |
|---|---|
| GetCertHash() |
Devolve o valor de hash do certificado X.509v3 como um array de bytes. |
| GetCertHash(HashAlgorithmName) |
Devolve o valor de hash para o certificado X.509v3 que é calculado usando o algoritmo de hash criptográfico especificado. |
GetCertHash()
- Origem:
- X509Certificate.cs
- Origem:
- X509Certificate.cs
- Origem:
- X509Certificate.cs
- Origem:
- X509Certificate.cs
- Origem:
- X509Certificate.cs
Devolve o valor de hash do certificado X.509v3 como um array de 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()
Devoluções
O valor de hash para o certificado X.509.
Exemplos
O exemplo seguinte utiliza o GetCertHash método para preencher um array de bytes com o valor de hash de um certificado X.509.
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
Aplica-se a
GetCertHash(HashAlgorithmName)
- Origem:
- X509Certificate.cs
- Origem:
- X509Certificate.cs
- Origem:
- X509Certificate.cs
- Origem:
- X509Certificate.cs
- Origem:
- X509Certificate.cs
Devolve o valor de hash para o certificado X.509v3 que é calculado usando o algoritmo de hash criptográfico especificado.
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()
Parâmetros
- hashAlgorithm
- HashAlgorithmName
O nome do algoritmo de hash criptográfico a utilizar.
Devoluções
Um array de bytes que contém o valor de hash do certificado X.509.
Exceções
hashAlgorithm.Name é null ou uma corda vazia.
hashAlgorithm não é um algoritmo de hash conhecido.