31 lines
876 B
C#
31 lines
876 B
C#
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
|
#pragma warning disable
|
|
using System;
|
|
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
|
|
{
|
|
public class TlsECDsaSigner
|
|
: TlsDsaSigner
|
|
{
|
|
public override bool IsValidPublicKey(AsymmetricKeyParameter publicKey)
|
|
{
|
|
return publicKey is ECPublicKeyParameters;
|
|
}
|
|
|
|
protected override IDsa CreateDsaImpl(byte hashAlgorithm)
|
|
{
|
|
return new ECDsaSigner(new HMacDsaKCalculator(TlsUtilities.CreateHash(hashAlgorithm)));
|
|
}
|
|
|
|
protected override byte SignatureAlgorithm
|
|
{
|
|
get { return Tls.SignatureAlgorithm.ecdsa; }
|
|
}
|
|
}
|
|
}
|
|
#pragma warning restore
|
|
#endif
|