TSPAlgorithms.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System.Collections;
  4. using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro;
  5. using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.GM;
  6. using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist;
  7. using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw;
  8. using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
  9. using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Rosstandart;
  10. using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust;
  11. using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
  12. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp
  13. {
  14. /**
  15. * Recognised hash algorithms for the time stamp protocol.
  16. */
  17. public abstract class TspAlgorithms
  18. {
  19. public static readonly string MD5 = PkcsObjectIdentifiers.MD5.Id;
  20. public static readonly string Sha1 = OiwObjectIdentifiers.IdSha1.Id;
  21. public static readonly string Sha224 = NistObjectIdentifiers.IdSha224.Id;
  22. public static readonly string Sha256 = NistObjectIdentifiers.IdSha256.Id;
  23. public static readonly string Sha384 = NistObjectIdentifiers.IdSha384.Id;
  24. public static readonly string Sha512 = NistObjectIdentifiers.IdSha512.Id;
  25. public static readonly string RipeMD128 = TeleTrusTObjectIdentifiers.RipeMD128.Id;
  26. public static readonly string RipeMD160 = TeleTrusTObjectIdentifiers.RipeMD160.Id;
  27. public static readonly string RipeMD256 = TeleTrusTObjectIdentifiers.RipeMD256.Id;
  28. public static readonly string Gost3411 = CryptoProObjectIdentifiers.GostR3411.Id;
  29. public static readonly string Gost3411_2012_256 = RosstandartObjectIdentifiers.id_tc26_gost_3411_12_256.Id;
  30. public static readonly string Gost3411_2012_512 = RosstandartObjectIdentifiers.id_tc26_gost_3411_12_512.Id;
  31. public static readonly string SM3 = GMObjectIdentifiers.sm3.Id;
  32. public static readonly IList Allowed;
  33. static TspAlgorithms()
  34. {
  35. string[] algs = new string[]
  36. {
  37. Gost3411, Gost3411_2012_256, Gost3411_2012_512, MD5, RipeMD128, RipeMD160, RipeMD256, Sha1, Sha224, Sha256, Sha384, Sha512, SM3
  38. };
  39. Allowed = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList();
  40. foreach (string alg in algs)
  41. {
  42. Allowed.Add(alg);
  43. }
  44. }
  45. }
  46. }
  47. #pragma warning restore
  48. #endif