TSPAlgorithms.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System.Collections.Generic;
  4. using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro;
  5. using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.GM;
  6. using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist;
  7. using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw;
  8. using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
  9. using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Rosstandart;
  10. using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust;
  11. using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections;
  12. namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Tsp
  13. {
  14. /**
  15. * Recognised hash algorithms for the time stamp protocol.
  16. */
  17. public static 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<string> Allowed;
  33. static TspAlgorithms()
  34. {
  35. Allowed = CollectionUtilities.ReadOnly(new List<string>()
  36. {
  37. Gost3411, Gost3411_2012_256, Gost3411_2012_512, MD5, RipeMD128, RipeMD160, RipeMD256, Sha1, Sha224,
  38. Sha256, Sha384, Sha512, SM3
  39. });
  40. }
  41. }
  42. }
  43. #pragma warning restore
  44. #endif