BcTlsDsaVerifier.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 the verification of the raw DSA signature type using the BC light-weight API.
  10. /// </summary>
  11. public class BcTlsDsaVerifier
  12. : BcTlsDssVerifier
  13. {
  14. public BcTlsDsaVerifier(BcTlsCrypto crypto, DsaPublicKeyParameters publicKey)
  15. : base(crypto, publicKey)
  16. {
  17. }
  18. protected override IDsa CreateDsaImpl(int cryptoHashAlgorithm)
  19. {
  20. return new DsaSigner(new HMacDsaKCalculator(m_crypto.CreateDigest(cryptoHashAlgorithm)));
  21. }
  22. protected override short SignatureAlgorithm
  23. {
  24. get { return Tls.SignatureAlgorithm.dsa; }
  25. }
  26. }
  27. }
  28. #pragma warning restore
  29. #endif