TlsDssSigner.cs 753 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 TlsDssSigner
  8. : TlsDsaSigner
  9. {
  10. public override bool IsValidPublicKey(AsymmetricKeyParameter publicKey)
  11. {
  12. return publicKey is DsaPublicKeyParameters;
  13. }
  14. protected override IDsa CreateDsaImpl(byte hashAlgorithm)
  15. {
  16. return new DsaSigner(new HMacDsaKCalculator(TlsUtilities.CreateHash(hashAlgorithm)));
  17. }
  18. protected override byte SignatureAlgorithm
  19. {
  20. get { return Tls.SignatureAlgorithm.dsa; }
  21. }
  22. }
  23. }
  24. #endif