3 // Copyright (c) Microsoft Corporation. All rights reserved.
6 // <OWNER>Microsoft</OWNER>
10 // AsymmetricSignatureFormatter.cs
13 namespace System.Security.Cryptography {
15 using System.Diagnostics.Contracts;
17 [System.Runtime.InteropServices.ComVisible(true)]
18 public abstract class AsymmetricSignatureFormatter {
20 // protected constructors
23 protected AsymmetricSignatureFormatter() {
30 abstract public void SetKey(AsymmetricAlgorithm key);
31 abstract public void SetHashAlgorithm(String strName);
33 public virtual byte[] CreateSignature(HashAlgorithm hash) {
34 if (hash == null) throw new ArgumentNullException("hash");
35 Contract.EndContractBlock();
36 SetHashAlgorithm(hash.ToString());
37 return CreateSignature(hash.Hash);
40 abstract public byte[] CreateSignature(byte[] rgbHash);