using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// Represents the base class from which all implementations of asymmetric signature formatters derive.
// Token: 0x020004E9 RID: 1257
[ComVisible(true)]
public abstract class AsymmetricSignatureFormatter
{
/// When overridden in a derived class, sets the hash algorithm to use for creating the signature.
/// The name of the hash algorithm to use for creating the signature.
// Token: 0x06002E99 RID: 11929
public abstract void SetHashAlgorithm(string strName);
/// When overridden in a derived class, sets the asymmetric algorithm to use to create the signature.
/// The instance of the implementation of to use to create the signature.
// Token: 0x06002E9A RID: 11930
public abstract void SetKey(AsymmetricAlgorithm key);
/// When overridden in a derived class, creates the signature for the specified data.
/// The digital signature for the parameter.
/// The data to be signed.
// Token: 0x06002E9B RID: 11931
public abstract byte[] CreateSignature(byte[] rgbHash);
/// Creates the signature from the specified hash value.
/// The signature for the specified hash value.
/// The hash algorithm to use to create the signature.
/// The parameter is null.
// Token: 0x06002E9C RID: 11932 RVA: 0x000951F4 File Offset: 0x000933F4
public virtual byte[] CreateSignature(HashAlgorithm hash)
{
if (hash == null)
{
throw new ArgumentNullException("hash");
}
this.SetHashAlgorithm(hash.ToString());
return this.CreateSignature(hash.Hash);
}
}
}