X9ObjectIdentifiers.cs 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. namespace Org.BouncyCastle.Asn1.X9
  4. {
  5. public abstract class X9ObjectIdentifiers
  6. {
  7. //
  8. // X9.62
  9. //
  10. // ansi-X9-62 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
  11. // us(840) ansi-x962(10045) }
  12. //
  13. internal const string AnsiX962 = "1.2.840.10045";
  14. public static readonly DerObjectIdentifier ansi_X9_62 = new DerObjectIdentifier(AnsiX962);
  15. public static readonly DerObjectIdentifier IdFieldType = ansi_X9_62.Branch("1");
  16. public static readonly DerObjectIdentifier PrimeField = IdFieldType.Branch("1");
  17. public static readonly DerObjectIdentifier CharacteristicTwoField = IdFieldType.Branch("2");
  18. public static readonly DerObjectIdentifier GNBasis = CharacteristicTwoField.Branch("3.1");
  19. public static readonly DerObjectIdentifier TPBasis = CharacteristicTwoField.Branch("3.2");
  20. public static readonly DerObjectIdentifier PPBasis = CharacteristicTwoField.Branch("3.3");
  21. [Obsolete("Use 'id_ecSigType' instead")]
  22. public const string IdECSigType = AnsiX962 + ".4";
  23. public static readonly DerObjectIdentifier id_ecSigType = ansi_X9_62.Branch("4");
  24. public static readonly DerObjectIdentifier ECDsaWithSha1 = id_ecSigType.Branch("1");
  25. [Obsolete("Use 'id_publicKeyType' instead")]
  26. public const string IdPublicKeyType = AnsiX962 + ".2";
  27. public static readonly DerObjectIdentifier id_publicKeyType = ansi_X9_62.Branch("2");
  28. public static readonly DerObjectIdentifier IdECPublicKey = id_publicKeyType.Branch("1");
  29. public static readonly DerObjectIdentifier ECDsaWithSha2 = id_ecSigType.Branch("3");
  30. public static readonly DerObjectIdentifier ECDsaWithSha224 = ECDsaWithSha2.Branch("1");
  31. public static readonly DerObjectIdentifier ECDsaWithSha256 = ECDsaWithSha2.Branch("2");
  32. public static readonly DerObjectIdentifier ECDsaWithSha384 = ECDsaWithSha2.Branch("3");
  33. public static readonly DerObjectIdentifier ECDsaWithSha512 = ECDsaWithSha2.Branch("4");
  34. //
  35. // named curves
  36. //
  37. public static readonly DerObjectIdentifier EllipticCurve = ansi_X9_62.Branch("3");
  38. //
  39. // Two Curves
  40. //
  41. public static readonly DerObjectIdentifier CTwoCurve = EllipticCurve.Branch("0");
  42. public static readonly DerObjectIdentifier C2Pnb163v1 = CTwoCurve.Branch("1");
  43. public static readonly DerObjectIdentifier C2Pnb163v2 = CTwoCurve.Branch("2");
  44. public static readonly DerObjectIdentifier C2Pnb163v3 = CTwoCurve.Branch("3");
  45. public static readonly DerObjectIdentifier C2Pnb176w1 = CTwoCurve.Branch("4");
  46. public static readonly DerObjectIdentifier C2Tnb191v1 = CTwoCurve.Branch("5");
  47. public static readonly DerObjectIdentifier C2Tnb191v2 = CTwoCurve.Branch("6");
  48. public static readonly DerObjectIdentifier C2Tnb191v3 = CTwoCurve.Branch("7");
  49. public static readonly DerObjectIdentifier C2Onb191v4 = CTwoCurve.Branch("8");
  50. public static readonly DerObjectIdentifier C2Onb191v5 = CTwoCurve.Branch("9");
  51. public static readonly DerObjectIdentifier C2Pnb208w1 = CTwoCurve.Branch("10");
  52. public static readonly DerObjectIdentifier C2Tnb239v1 = CTwoCurve.Branch("11");
  53. public static readonly DerObjectIdentifier C2Tnb239v2 = CTwoCurve.Branch("12");
  54. public static readonly DerObjectIdentifier C2Tnb239v3 = CTwoCurve.Branch("13");
  55. public static readonly DerObjectIdentifier C2Onb239v4 = CTwoCurve.Branch("14");
  56. public static readonly DerObjectIdentifier C2Onb239v5 = CTwoCurve.Branch("15");
  57. public static readonly DerObjectIdentifier C2Pnb272w1 = CTwoCurve.Branch("16");
  58. public static readonly DerObjectIdentifier C2Pnb304w1 = CTwoCurve.Branch("17");
  59. public static readonly DerObjectIdentifier C2Tnb359v1 = CTwoCurve.Branch("18");
  60. public static readonly DerObjectIdentifier C2Pnb368w1 = CTwoCurve.Branch("19");
  61. public static readonly DerObjectIdentifier C2Tnb431r1 = CTwoCurve.Branch("20");
  62. //
  63. // Prime
  64. //
  65. public static readonly DerObjectIdentifier PrimeCurve = EllipticCurve.Branch("1");
  66. public static readonly DerObjectIdentifier Prime192v1 = PrimeCurve.Branch("1");
  67. public static readonly DerObjectIdentifier Prime192v2 = PrimeCurve.Branch("2");
  68. public static readonly DerObjectIdentifier Prime192v3 = PrimeCurve.Branch("3");
  69. public static readonly DerObjectIdentifier Prime239v1 = PrimeCurve.Branch("4");
  70. public static readonly DerObjectIdentifier Prime239v2 = PrimeCurve.Branch("5");
  71. public static readonly DerObjectIdentifier Prime239v3 = PrimeCurve.Branch("6");
  72. public static readonly DerObjectIdentifier Prime256v1 = PrimeCurve.Branch("7");
  73. //
  74. // DSA
  75. //
  76. // dsapublicnumber OBJECT IDENTIFIER ::= { iso(1) member-body(2)
  77. // us(840) ansi-x957(10040) number-type(4) 1 }
  78. public static readonly DerObjectIdentifier IdDsa = new DerObjectIdentifier("1.2.840.10040.4.1");
  79. /**
  80. * id-dsa-with-sha1 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
  81. * us(840) x9-57 (10040) x9cm(4) 3 }
  82. */
  83. public static readonly DerObjectIdentifier IdDsaWithSha1 = new DerObjectIdentifier("1.2.840.10040.4.3");
  84. /**
  85. * X9.63
  86. */
  87. public static readonly DerObjectIdentifier X9x63Scheme = new DerObjectIdentifier("1.3.133.16.840.63.0");
  88. public static readonly DerObjectIdentifier DHSinglePassStdDHSha1KdfScheme = X9x63Scheme.Branch("2");
  89. public static readonly DerObjectIdentifier DHSinglePassCofactorDHSha1KdfScheme = X9x63Scheme.Branch("3");
  90. public static readonly DerObjectIdentifier MqvSinglePassSha1KdfScheme = X9x63Scheme.Branch("16");
  91. /**
  92. * X9.42
  93. */
  94. public static readonly DerObjectIdentifier ansi_x9_42 = new DerObjectIdentifier("1.2.840.10046");
  95. //
  96. // Diffie-Hellman
  97. //
  98. // dhpublicnumber OBJECT IDENTIFIER ::= { iso(1) member-body(2)
  99. // us(840) ansi-x942(10046) number-type(2) 1 }
  100. //
  101. public static readonly DerObjectIdentifier DHPublicNumber = ansi_x9_42.Branch("2.1");
  102. public static readonly DerObjectIdentifier X9x42Schemes = ansi_x9_42.Branch("2.3");
  103. public static readonly DerObjectIdentifier DHStatic = X9x42Schemes.Branch("1");
  104. public static readonly DerObjectIdentifier DHEphem = X9x42Schemes.Branch("2");
  105. public static readonly DerObjectIdentifier DHOneFlow = X9x42Schemes.Branch("3");
  106. public static readonly DerObjectIdentifier DHHybrid1 = X9x42Schemes.Branch("4");
  107. public static readonly DerObjectIdentifier DHHybrid2 = X9x42Schemes.Branch("5");
  108. public static readonly DerObjectIdentifier DHHybridOneFlow = X9x42Schemes.Branch("6");
  109. public static readonly DerObjectIdentifier Mqv2 = X9x42Schemes.Branch("7");
  110. public static readonly DerObjectIdentifier Mqv1 = X9x42Schemes.Branch("8");
  111. }
  112. }
  113. #endif