英語で読む

次の方法で共有


DSASignatureFormatter クラス

定義

デジタル署名アルゴリズム (DSA) 署名を作成します。

C#
public class DSASignatureFormatter : System.Security.Cryptography.AsymmetricSignatureFormatter
C#
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public class DSASignatureFormatter : System.Security.Cryptography.AsymmetricSignatureFormatter
C#
[System.Runtime.InteropServices.ComVisible(true)]
public class DSASignatureFormatter : System.Security.Cryptography.AsymmetricSignatureFormatter
継承
DSASignatureFormatter
属性

C#
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);
        }
    }
}

注釈

重要

DSA アルゴリズムの作成者は、そのサポートを取り消しました。 クラスではなく、 クラスまたは ECDsa クラスをDSA使用RSAすることを検討してください。 従来のアプリケーションとデータとの互換性のためにのみ使用 DSA します。

コンストラクター

DSASignatureFormatter()

DSASignatureFormatter クラスの新しいインスタンスを初期化します。

DSASignatureFormatter(AsymmetricAlgorithm)

指定したキーで、DSASignatureFormatter クラスの新しいインスタンスを初期化します。

メソッド

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)

適用対象

製品 バージョン
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

こちらもご覧ください