X509Certificate.GetCertHash 메서드

정의

X509Certificate 개체에 대한 해시 값을 반환합니다.

오버로드

GetCertHash()

X.509v3 인증서에 대한 해시 값을 바이트 배열로 반환합니다.

GetCertHash(HashAlgorithmName)

지정된 암호화 해시 알고리즘을 사용하여 계산된 X.509v3 인증서에 대한 해시 값을 반환합니다.

GetCertHash()

Source:
X509Certificate.cs
Source:
X509Certificate.cs
Source:
X509Certificate.cs

X.509v3 인증서에 대한 해시 값을 바이트 배열로 반환합니다.

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()

반환

Byte[]

Authenticode X.509 v.3 인증서에 대한 해시 값입니다.

예제

다음 예제에서는 메서드를 GetCertHash 사용하여 바이트 배열을 X.509 인증서의 해시 값으로 채웁니다.

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

적용 대상

GetCertHash(HashAlgorithmName)

Source:
X509Certificate.cs
Source:
X509Certificate.cs
Source:
X509Certificate.cs

지정된 암호화 해시 알고리즘을 사용하여 계산된 X.509v3 인증서에 대한 해시 값을 반환합니다.

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()

매개 변수

hashAlgorithm
HashAlgorithmName

사용할 암호화 해시 알고리즘의 이름입니다.

반환

Byte[]

X.509 인증서에 대한 해시 값이 포함된 바이트 배열입니다.

예외

hashAlgorithm.Namenull 또는 빈 문자열입니다.

hashAlgorithm은 알려진 해시 알고리즘이 아닙니다.

추가 정보

적용 대상