You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1019 B

2 months ago
using System;
using Org.BouncyCastle.Crypto;
namespace Org.BouncyCastle.Tls.Crypto.Impl.BC
{
public abstract class BcTlsSigner
: TlsSigner
{
protected readonly BcTlsCrypto m_crypto;
protected readonly AsymmetricKeyParameter m_privateKey;
protected BcTlsSigner(BcTlsCrypto crypto, AsymmetricKeyParameter privateKey)
{
if (crypto == null)
throw new ArgumentNullException("crypto");
if (privateKey == null)
throw new ArgumentNullException("privateKey");
if (!privateKey.IsPrivate)
throw new ArgumentException("must be private", "privateKey");
this.m_crypto = crypto;
this.m_privateKey = privateKey;
}
public abstract byte[] GenerateRawSignature(SignatureAndHashAlgorithm algorithm, byte[] hash);
public virtual TlsStreamSigner GetStreamSigner(SignatureAndHashAlgorithm algorithm)
{
return null;
}
}
}