SHA1CryptoServiceProvider 클래스
CSP(암호화 서비스 공급자)가 제공하는 구현을 사용하는 입력 데이터에 대해 SHA1 해시 값을 계산합니다. 이 클래스는 상속될 수 없습니다.
네임스페이스: System.Security.Cryptography
어셈블리: mscorlib(mscorlib.dll)
구문
‘선언
<ComVisibleAttribute(True)> _
Public NotInheritable Class SHA1CryptoServiceProvider
Inherits SHA1
‘사용 방법
Dim instance As SHA1CryptoServiceProvider
[ComVisibleAttribute(true)]
public sealed class SHA1CryptoServiceProvider : SHA1
[ComVisibleAttribute(true)]
public ref class SHA1CryptoServiceProvider sealed : public SHA1
/** @attribute ComVisibleAttribute(true) */
public final class SHA1CryptoServiceProvider extends SHA1
ComVisibleAttribute(true)
public final class SHA1CryptoServiceProvider extends SHA1
설명
SHA1CryptoServiceProvider 클래스에 대한 해시 크기는 160비트입니다.
예제
다음 코드 예제에서는 data
의 SHA1 해시 값을 계산하여 이를 result
에 저장합니다. 이 예제에서는 미리 정의된 상수 DATA_SIZE
가 있는 것으로 가정합니다.
Dim data(DATA_SIZE) As Byte
Dim result() As Byte
Dim sha As New SHA1CryptoServiceProvider()
' This is one implementation of the abstract class SHA1.
result = sha.ComputeHash(data)
byte[] data = new byte[DATA_SIZE];
byte[] result;
SHA1 sha = new SHA1CryptoServiceProvider();
// This is one implementation of the abstract class SHA1.
result = sha.ComputeHash(data);
array<Byte>^ data = gcnew array<Byte>( DATA_SIZE );
array<Byte>^ result;
SHA1^ sha = gcnew SHA1CryptoServiceProvider;
// This is one implementation of the abstract class SHA1.
result = sha->ComputeHash( data );
ubyte data[] = new ubyte[data_Size];
ubyte result[];
SHA1 sha = new SHA1CryptoServiceProvider();
// This is one implementation of the abstract class SHA1.
result = sha.ComputeHash(data);
상속 계층 구조
System.Object
System.Security.Cryptography.HashAlgorithm
System.Security.Cryptography.SHA1
System.Security.Cryptography.SHA1CryptoServiceProvider
스레드로부터의 안전성
이 형식의 모든 public static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.
플랫폼
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
2.0, 1.1, 1.0에서 지원
.NET Compact Framework
2.0에서 지원
참고 항목
참조
SHA1CryptoServiceProvider 멤버
System.Security.Cryptography 네임스페이스