X509Certificate.GetCertHash 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
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()
반환
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
사용할 암호화 해시 알고리즘의 이름입니다.
반환
X.509 인증서에 대한 해시 값이 포함된 바이트 배열입니다.
예외
hashAlgorithm
.Name이 null
또는 빈 문자열입니다.
hashAlgorithm
은 알려진 해시 알고리즘이 아닙니다.