DSASignatureFormatter 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
디지털 서명 알고리즘(DSA) 서명을 만듭니다.
public ref class DSASignatureFormatter : System::Security::Cryptography::AsymmetricSignatureFormatter
public class DSASignatureFormatter : System.Security.Cryptography.AsymmetricSignatureFormatter
[System.Runtime.InteropServices.ComVisible(true)]
public class DSASignatureFormatter : System.Security.Cryptography.AsymmetricSignatureFormatter
type DSASignatureFormatter = class
inherit AsymmetricSignatureFormatter
[<System.Runtime.InteropServices.ComVisible(true)>]
type DSASignatureFormatter = class
inherit AsymmetricSignatureFormatter
Public Class DSASignatureFormatter
Inherits AsymmetricSignatureFormatter
- 상속
- 특성
예제
using System;
using System.Security.Cryptography;
class DSASample
{
static void Main()
{
try
{
//Create a new instance of DSA.
DSA DSA = DSA.Create();
//The hash to sign.
byte[] Hash = {59,4,248,102,77,97,142,201,210,12,224,93,25,41,100,197,213,134,130,135};
//Create an DSASignatureFormatter object and pass it the
//DSA instance to transfer the key information.
DSASignatureFormatter DSAFormatter = new DSASignatureFormatter(DSA);
//Set the hash algorithm to SHA1.
DSAFormatter.SetHashAlgorithm("SHA1");
//Create a signature for HashValue and return it.
byte[] SignedHash = DSAFormatter.CreateSignature(Hash);
}
catch(CryptographicException e)
{
Console.WriteLine(e.Message);
}
}
}
Imports System.Security.Cryptography
_
Class DSASample
Shared Sub Main()
Try
'Create a new instance of DSA.
Dim DSA As DSA = DSA.Create()
'The hash to sign.
Dim Hash As Byte() = {59, 4, 248, 102, 77, 97, 142, 201, 210, 12, 224, 93, 25, 41, 100, 197, 213, 134, 130, 135}
'Create an DSASignatureFormatter object and pass it the
'DSA instance to transfer the key information.
Dim DSAFormatter As New DSASignatureFormatter(DSA)
'Set the hash algorithm to SHA1.
DSAFormatter.SetHashAlgorithm("SHA1")
'Create a signature for HashValue and return it.
Dim SignedHash As Byte() = DSAFormatter.CreateSignature(Hash)
Catch e As CryptographicException
Console.WriteLine(e.Message)
End Try
End Sub
End Class
설명
Important
DSA 알고리즘의 작성자는 해당 알고리즘에 대한 지원을 철회했습니다. 다른 RSA 클래스를 사용하는 대신 ECDsa 클래스나 DSA 클래스를 사용하는 것이 좋습니다. 레거시 애플리케이션 및 데이터와의 호환성에만 사용합니다 DSA .
생성자
| Name | Description |
|---|---|
| DSASignatureFormatter() |
DSASignatureFormatter 클래스의 새 인스턴스를 초기화합니다. |
| DSASignatureFormatter(AsymmetricAlgorithm) |
지정된 키를 사용하여 클래스의 DSASignatureFormatter 새 인스턴스를 초기화합니다. |
메서드
| Name | Description |
|---|---|
| CreateSignature(Byte[]) |
지정된 데이터에 대한 디지털 서명 알고리즘(DSA) PKCS #1 서명을 만듭니다. |
| CreateSignature(HashAlgorithm) |
지정된 해시 값에서 서명을 만듭니다. (다음에서 상속됨 AsymmetricSignatureFormatter) |
| Equals(Object) |
지정한 개체와 현재 개체가 같은지 여부를 확인합니다. (다음에서 상속됨 Object) |
| GetHashCode() |
기본 해시 함수로 작동합니다. (다음에서 상속됨 Object) |
| GetType() |
현재 인스턴스의 Type 가져옵니다. (다음에서 상속됨 Object) |
| MemberwiseClone() |
현재 Object단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
| SetHashAlgorithm(String) |
디지털 서명 알고리즘(DSA) 서명 포맷터에 대한 해시 알고리즘을 지정합니다. |
| SetKey(AsymmetricAlgorithm) |
디지털 서명 알고리즘(DSA) 서명 포맷터에 사용할 키를 지정합니다. |
| ToString() |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |