TlsECDsaSigner.cs 758 B

123456789101112131415161718192021222324252627282930
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. using Org.BouncyCastle.Crypto.Parameters;
  4. using Org.BouncyCastle.Crypto.Signers;
  5. namespace Org.BouncyCastle.Crypto.Tls
  6. {
  7. public class TlsECDsaSigner
  8. : TlsDsaSigner
  9. {
  10. public override bool IsValidPublicKey(AsymmetricKeyParameter publicKey)
  11. {
  12. return publicKey is ECPublicKeyParameters;
  13. }
  14. protected override IDsa CreateDsaImpl(byte hashAlgorithm)
  15. {
  16. return new ECDsaSigner(new HMacDsaKCalculator(TlsUtilities.CreateHash(hashAlgorithm)));
  17. }
  18. protected override byte SignatureAlgorithm
  19. {
  20. get { return Tls.SignatureAlgorithm.ecdsa; }
  21. }
  22. }
  23. }
  24. #endif