BcTlsECDsaSigner.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
  5. using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
  6. using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers;
  7. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tls.Crypto.Impl.BC
  8. {
  9. /// <summary>Implementation class for generation of the raw ECDSA signature type using the BC light-weight API.
  10. /// </summary>
  11. public class BcTlsECDsaSigner
  12. : BcTlsDssSigner
  13. {
  14. public BcTlsECDsaSigner(BcTlsCrypto crypto, ECPrivateKeyParameters privateKey)
  15. : base(crypto, privateKey)
  16. {
  17. }
  18. protected override IDsa CreateDsaImpl(int cryptoHashAlgorithm)
  19. {
  20. return new ECDsaSigner(new HMacDsaKCalculator(m_crypto.CreateDigest(cryptoHashAlgorithm)));
  21. }
  22. protected override short SignatureAlgorithm
  23. {
  24. get { return Tls.SignatureAlgorithm.ecdsa; }
  25. }
  26. }
  27. }
  28. #pragma warning restore
  29. #endif