init commit

This commit is contained in:
2025-10-09 09:57:24 +09:00
commit 4d551bd74f
6636 changed files with 1218703 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
namespace Org.BouncyCastle.Crypto.Tls;
public abstract class AbstractTlsSigner : TlsSigner
{
protected TlsContext mContext;
public virtual void Init(TlsContext context)
{
mContext = context;
}
public virtual byte[] GenerateRawSignature(AsymmetricKeyParameter privateKey, byte[] md5AndSha1)
{
return GenerateRawSignature(null, privateKey, md5AndSha1);
}
public abstract byte[] GenerateRawSignature(SignatureAndHashAlgorithm algorithm, AsymmetricKeyParameter privateKey, byte[] hash);
public virtual bool VerifyRawSignature(byte[] sigBytes, AsymmetricKeyParameter publicKey, byte[] md5AndSha1)
{
return VerifyRawSignature(null, sigBytes, publicKey, md5AndSha1);
}
public abstract bool VerifyRawSignature(SignatureAndHashAlgorithm algorithm, byte[] sigBytes, AsymmetricKeyParameter publicKey, byte[] hash);
public virtual ISigner CreateSigner(AsymmetricKeyParameter privateKey)
{
return CreateSigner(null, privateKey);
}
public abstract ISigner CreateSigner(SignatureAndHashAlgorithm algorithm, AsymmetricKeyParameter privateKey);
public virtual ISigner CreateVerifyer(AsymmetricKeyParameter publicKey)
{
return CreateVerifyer(null, publicKey);
}
public abstract ISigner CreateVerifyer(SignatureAndHashAlgorithm algorithm, AsymmetricKeyParameter publicKey);
public abstract bool IsValidPublicKey(AsymmetricKeyParameter publicKey);
}