PKCSObjectIdentifiers.cs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. namespace Org.BouncyCastle.Asn1.Pkcs
  4. {
  5. public abstract class PkcsObjectIdentifiers
  6. {
  7. //
  8. // pkcs-1 OBJECT IDENTIFIER ::= {
  9. // iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 1 }
  10. //
  11. public const string Pkcs1 = "1.2.840.113549.1.1";
  12. public static readonly DerObjectIdentifier RsaEncryption = new DerObjectIdentifier(Pkcs1 + ".1");
  13. public static readonly DerObjectIdentifier MD2WithRsaEncryption = new DerObjectIdentifier(Pkcs1 + ".2");
  14. public static readonly DerObjectIdentifier MD4WithRsaEncryption = new DerObjectIdentifier(Pkcs1 + ".3");
  15. public static readonly DerObjectIdentifier MD5WithRsaEncryption = new DerObjectIdentifier(Pkcs1 + ".4");
  16. public static readonly DerObjectIdentifier Sha1WithRsaEncryption = new DerObjectIdentifier(Pkcs1 + ".5");
  17. public static readonly DerObjectIdentifier SrsaOaepEncryptionSet = new DerObjectIdentifier(Pkcs1 + ".6");
  18. public static readonly DerObjectIdentifier IdRsaesOaep = new DerObjectIdentifier(Pkcs1 + ".7");
  19. public static readonly DerObjectIdentifier IdMgf1 = new DerObjectIdentifier(Pkcs1 + ".8");
  20. public static readonly DerObjectIdentifier IdPSpecified = new DerObjectIdentifier(Pkcs1 + ".9");
  21. public static readonly DerObjectIdentifier IdRsassaPss = new DerObjectIdentifier(Pkcs1 + ".10");
  22. public static readonly DerObjectIdentifier Sha256WithRsaEncryption = new DerObjectIdentifier(Pkcs1 + ".11");
  23. public static readonly DerObjectIdentifier Sha384WithRsaEncryption = new DerObjectIdentifier(Pkcs1 + ".12");
  24. public static readonly DerObjectIdentifier Sha512WithRsaEncryption = new DerObjectIdentifier(Pkcs1 + ".13");
  25. public static readonly DerObjectIdentifier Sha224WithRsaEncryption = new DerObjectIdentifier(Pkcs1 + ".14");
  26. //
  27. // pkcs-3 OBJECT IDENTIFIER ::= {
  28. // iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 3 }
  29. //
  30. public const string Pkcs3 = "1.2.840.113549.1.3";
  31. public static readonly DerObjectIdentifier DhKeyAgreement = new DerObjectIdentifier(Pkcs3 + ".1");
  32. //
  33. // pkcs-5 OBJECT IDENTIFIER ::= {
  34. // iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 5 }
  35. //
  36. public const string Pkcs5 = "1.2.840.113549.1.5";
  37. public static readonly DerObjectIdentifier PbeWithMD2AndDesCbc = new DerObjectIdentifier(Pkcs5 + ".1");
  38. public static readonly DerObjectIdentifier PbeWithMD2AndRC2Cbc = new DerObjectIdentifier(Pkcs5 + ".4");
  39. public static readonly DerObjectIdentifier PbeWithMD5AndDesCbc = new DerObjectIdentifier(Pkcs5 + ".3");
  40. public static readonly DerObjectIdentifier PbeWithMD5AndRC2Cbc = new DerObjectIdentifier(Pkcs5 + ".6");
  41. public static readonly DerObjectIdentifier PbeWithSha1AndDesCbc = new DerObjectIdentifier(Pkcs5 + ".10");
  42. public static readonly DerObjectIdentifier PbeWithSha1AndRC2Cbc = new DerObjectIdentifier(Pkcs5 + ".11");
  43. public static readonly DerObjectIdentifier IdPbeS2 = new DerObjectIdentifier(Pkcs5 + ".13");
  44. public static readonly DerObjectIdentifier IdPbkdf2 = new DerObjectIdentifier(Pkcs5 + ".12");
  45. //
  46. // encryptionAlgorithm OBJECT IDENTIFIER ::= {
  47. // iso(1) member-body(2) us(840) rsadsi(113549) 3 }
  48. //
  49. public const string EncryptionAlgorithm = "1.2.840.113549.3";
  50. public static readonly DerObjectIdentifier DesEde3Cbc = new DerObjectIdentifier(EncryptionAlgorithm + ".7");
  51. public static readonly DerObjectIdentifier RC2Cbc = new DerObjectIdentifier(EncryptionAlgorithm + ".2");
  52. //
  53. // object identifiers for digests
  54. //
  55. public const string DigestAlgorithm = "1.2.840.113549.2";
  56. //
  57. // md2 OBJECT IDENTIFIER ::=
  58. // {iso(1) member-body(2) US(840) rsadsi(113549) DigestAlgorithm(2) 2}
  59. //
  60. public static readonly DerObjectIdentifier MD2 = new DerObjectIdentifier(DigestAlgorithm + ".2");
  61. //
  62. // md4 OBJECT IDENTIFIER ::=
  63. // {iso(1) member-body(2) US(840) rsadsi(113549) DigestAlgorithm(2) 4}
  64. //
  65. public static readonly DerObjectIdentifier MD4 = new DerObjectIdentifier(DigestAlgorithm + ".4");
  66. //
  67. // md5 OBJECT IDENTIFIER ::=
  68. // {iso(1) member-body(2) US(840) rsadsi(113549) DigestAlgorithm(2) 5}
  69. //
  70. public static readonly DerObjectIdentifier MD5 = new DerObjectIdentifier(DigestAlgorithm + ".5");
  71. public static readonly DerObjectIdentifier IdHmacWithSha1 = new DerObjectIdentifier(DigestAlgorithm + ".7");
  72. public static readonly DerObjectIdentifier IdHmacWithSha224 = new DerObjectIdentifier(DigestAlgorithm + ".8");
  73. public static readonly DerObjectIdentifier IdHmacWithSha256 = new DerObjectIdentifier(DigestAlgorithm + ".9");
  74. public static readonly DerObjectIdentifier IdHmacWithSha384 = new DerObjectIdentifier(DigestAlgorithm + ".10");
  75. public static readonly DerObjectIdentifier IdHmacWithSha512 = new DerObjectIdentifier(DigestAlgorithm + ".11");
  76. //
  77. // pkcs-7 OBJECT IDENTIFIER ::= {
  78. // iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 7 }
  79. //
  80. public const string Pkcs7 = "1.2.840.113549.1.7";
  81. public static readonly DerObjectIdentifier Data = new DerObjectIdentifier(Pkcs7 + ".1");
  82. public static readonly DerObjectIdentifier SignedData = new DerObjectIdentifier(Pkcs7 + ".2");
  83. public static readonly DerObjectIdentifier EnvelopedData = new DerObjectIdentifier(Pkcs7 + ".3");
  84. public static readonly DerObjectIdentifier SignedAndEnvelopedData = new DerObjectIdentifier(Pkcs7 + ".4");
  85. public static readonly DerObjectIdentifier DigestedData = new DerObjectIdentifier(Pkcs7 + ".5");
  86. public static readonly DerObjectIdentifier EncryptedData = new DerObjectIdentifier(Pkcs7 + ".6");
  87. //
  88. // pkcs-9 OBJECT IDENTIFIER ::= {
  89. // iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 }
  90. //
  91. public const string Pkcs9 = "1.2.840.113549.1.9";
  92. public static readonly DerObjectIdentifier Pkcs9AtEmailAddress = new DerObjectIdentifier(Pkcs9 + ".1");
  93. public static readonly DerObjectIdentifier Pkcs9AtUnstructuredName = new DerObjectIdentifier(Pkcs9 + ".2");
  94. public static readonly DerObjectIdentifier Pkcs9AtContentType = new DerObjectIdentifier(Pkcs9 + ".3");
  95. public static readonly DerObjectIdentifier Pkcs9AtMessageDigest = new DerObjectIdentifier(Pkcs9 + ".4");
  96. public static readonly DerObjectIdentifier Pkcs9AtSigningTime = new DerObjectIdentifier(Pkcs9 + ".5");
  97. public static readonly DerObjectIdentifier Pkcs9AtCounterSignature = new DerObjectIdentifier(Pkcs9 + ".6");
  98. public static readonly DerObjectIdentifier Pkcs9AtChallengePassword = new DerObjectIdentifier(Pkcs9 + ".7");
  99. public static readonly DerObjectIdentifier Pkcs9AtUnstructuredAddress = new DerObjectIdentifier(Pkcs9 + ".8");
  100. public static readonly DerObjectIdentifier Pkcs9AtExtendedCertificateAttributes = new DerObjectIdentifier(Pkcs9 + ".9");
  101. public static readonly DerObjectIdentifier Pkcs9AtSigningDescription = new DerObjectIdentifier(Pkcs9 + ".13");
  102. public static readonly DerObjectIdentifier Pkcs9AtExtensionRequest = new DerObjectIdentifier(Pkcs9 + ".14");
  103. public static readonly DerObjectIdentifier Pkcs9AtSmimeCapabilities = new DerObjectIdentifier(Pkcs9 + ".15");
  104. public static readonly DerObjectIdentifier IdSmime = new DerObjectIdentifier(Pkcs9 + ".16");
  105. public static readonly DerObjectIdentifier Pkcs9AtFriendlyName = new DerObjectIdentifier(Pkcs9 + ".20");
  106. public static readonly DerObjectIdentifier Pkcs9AtLocalKeyID = new DerObjectIdentifier(Pkcs9 + ".21");
  107. [Obsolete("Use X509Certificate instead")]
  108. public static readonly DerObjectIdentifier X509CertType = new DerObjectIdentifier(Pkcs9 + ".22.1");
  109. public const string CertTypes = Pkcs9 + ".22";
  110. public static readonly DerObjectIdentifier X509Certificate = new DerObjectIdentifier(CertTypes + ".1");
  111. public static readonly DerObjectIdentifier SdsiCertificate = new DerObjectIdentifier(CertTypes + ".2");
  112. public const string CrlTypes = Pkcs9 + ".23";
  113. public static readonly DerObjectIdentifier X509Crl = new DerObjectIdentifier(CrlTypes + ".1");
  114. public static readonly DerObjectIdentifier IdAlg = IdSmime.Branch("3");
  115. public static readonly DerObjectIdentifier IdAlgEsdh = IdAlg.Branch("5");
  116. public static readonly DerObjectIdentifier IdAlgCms3DesWrap = IdAlg.Branch("6");
  117. public static readonly DerObjectIdentifier IdAlgCmsRC2Wrap = IdAlg.Branch("7");
  118. public static readonly DerObjectIdentifier IdAlgPwriKek = IdAlg.Branch("9");
  119. public static readonly DerObjectIdentifier IdAlgSsdh = IdAlg.Branch("10");
  120. /*
  121. * <pre>
  122. * -- RSA-KEM Key Transport Algorithm
  123. *
  124. * id-rsa-kem OID ::= {
  125. * iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1)
  126. * pkcs-9(9) smime(16) alg(3) 14
  127. * }
  128. * </pre>
  129. */
  130. public static readonly DerObjectIdentifier IdRsaKem = IdAlg.Branch("14");
  131. //
  132. // SMIME capability sub oids.
  133. //
  134. public static readonly DerObjectIdentifier PreferSignedData = Pkcs9AtSmimeCapabilities.Branch("1");
  135. public static readonly DerObjectIdentifier CannotDecryptAny = Pkcs9AtSmimeCapabilities.Branch("2");
  136. public static readonly DerObjectIdentifier SmimeCapabilitiesVersions = Pkcs9AtSmimeCapabilities.Branch("3");
  137. //
  138. // other SMIME attributes
  139. //
  140. public static readonly DerObjectIdentifier IdAAReceiptRequest = IdSmime.Branch("2.1");
  141. //
  142. // id-ct OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840)
  143. // rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) ct(1)}
  144. //
  145. public const string IdCT = "1.2.840.113549.1.9.16.1";
  146. public static readonly DerObjectIdentifier IdCTAuthData = new DerObjectIdentifier(IdCT + ".2");
  147. public static readonly DerObjectIdentifier IdCTTstInfo = new DerObjectIdentifier(IdCT + ".4");
  148. public static readonly DerObjectIdentifier IdCTCompressedData = new DerObjectIdentifier(IdCT + ".9");
  149. public static readonly DerObjectIdentifier IdCTAuthEnvelopedData = new DerObjectIdentifier(IdCT + ".23");
  150. public static readonly DerObjectIdentifier IdCTTimestampedData = new DerObjectIdentifier(IdCT + ".31");
  151. //
  152. // id-cti OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840)
  153. // rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) cti(6)}
  154. //
  155. public const string IdCti = "1.2.840.113549.1.9.16.6";
  156. public static readonly DerObjectIdentifier IdCtiEtsProofOfOrigin = new DerObjectIdentifier(IdCti + ".1");
  157. public static readonly DerObjectIdentifier IdCtiEtsProofOfReceipt = new DerObjectIdentifier(IdCti + ".2");
  158. public static readonly DerObjectIdentifier IdCtiEtsProofOfDelivery = new DerObjectIdentifier(IdCti + ".3");
  159. public static readonly DerObjectIdentifier IdCtiEtsProofOfSender = new DerObjectIdentifier(IdCti + ".4");
  160. public static readonly DerObjectIdentifier IdCtiEtsProofOfApproval = new DerObjectIdentifier(IdCti + ".5");
  161. public static readonly DerObjectIdentifier IdCtiEtsProofOfCreation = new DerObjectIdentifier(IdCti + ".6");
  162. //
  163. // id-aa OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840)
  164. // rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) attributes(2)}
  165. //
  166. public const string IdAA = "1.2.840.113549.1.9.16.2";
  167. public static readonly DerObjectIdentifier IdAAContentHint = new DerObjectIdentifier(IdAA + ".4"); // See RFC 2634
  168. public static readonly DerObjectIdentifier IdAAMsgSigDigest = new DerObjectIdentifier(IdAA + ".5");
  169. public static readonly DerObjectIdentifier IdAAContentReference = new DerObjectIdentifier(IdAA + ".10");
  170. /*
  171. * id-aa-encrypKeyPref OBJECT IDENTIFIER ::= {id-aa 11}
  172. *
  173. */
  174. public static readonly DerObjectIdentifier IdAAEncrypKeyPref = new DerObjectIdentifier(IdAA + ".11");
  175. public static readonly DerObjectIdentifier IdAASigningCertificate = new DerObjectIdentifier(IdAA + ".12");
  176. public static readonly DerObjectIdentifier IdAASigningCertificateV2 = new DerObjectIdentifier(IdAA + ".47");
  177. public static readonly DerObjectIdentifier IdAAContentIdentifier = new DerObjectIdentifier(IdAA + ".7"); // See RFC 2634
  178. /*
  179. * RFC 3126
  180. */
  181. public static readonly DerObjectIdentifier IdAASignatureTimeStampToken = new DerObjectIdentifier(IdAA + ".14");
  182. public static readonly DerObjectIdentifier IdAAEtsSigPolicyID = new DerObjectIdentifier(IdAA + ".15");
  183. public static readonly DerObjectIdentifier IdAAEtsCommitmentType = new DerObjectIdentifier(IdAA + ".16");
  184. public static readonly DerObjectIdentifier IdAAEtsSignerLocation = new DerObjectIdentifier(IdAA + ".17");
  185. public static readonly DerObjectIdentifier IdAAEtsSignerAttr = new DerObjectIdentifier(IdAA + ".18");
  186. public static readonly DerObjectIdentifier IdAAEtsOtherSigCert = new DerObjectIdentifier(IdAA + ".19");
  187. public static readonly DerObjectIdentifier IdAAEtsContentTimestamp = new DerObjectIdentifier(IdAA + ".20");
  188. public static readonly DerObjectIdentifier IdAAEtsCertificateRefs = new DerObjectIdentifier(IdAA + ".21");
  189. public static readonly DerObjectIdentifier IdAAEtsRevocationRefs = new DerObjectIdentifier(IdAA + ".22");
  190. public static readonly DerObjectIdentifier IdAAEtsCertValues = new DerObjectIdentifier(IdAA + ".23");
  191. public static readonly DerObjectIdentifier IdAAEtsRevocationValues = new DerObjectIdentifier(IdAA + ".24");
  192. public static readonly DerObjectIdentifier IdAAEtsEscTimeStamp = new DerObjectIdentifier(IdAA + ".25");
  193. public static readonly DerObjectIdentifier IdAAEtsCertCrlTimestamp = new DerObjectIdentifier(IdAA + ".26");
  194. public static readonly DerObjectIdentifier IdAAEtsArchiveTimestamp = new DerObjectIdentifier(IdAA + ".27");
  195. [Obsolete("Use 'IdAAEtsSigPolicyID' instead")]
  196. public static readonly DerObjectIdentifier IdAASigPolicyID = IdAAEtsSigPolicyID;
  197. [Obsolete("Use 'IdAAEtsCommitmentType' instead")]
  198. public static readonly DerObjectIdentifier IdAACommitmentType = IdAAEtsCommitmentType;
  199. [Obsolete("Use 'IdAAEtsSignerLocation' instead")]
  200. public static readonly DerObjectIdentifier IdAASignerLocation = IdAAEtsSignerLocation;
  201. [Obsolete("Use 'IdAAEtsOtherSigCert' instead")]
  202. public static readonly DerObjectIdentifier IdAAOtherSigCert = IdAAEtsOtherSigCert;
  203. //
  204. // id-spq OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840)
  205. // rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) id-spq(5)}
  206. //
  207. public const string IdSpq = "1.2.840.113549.1.9.16.5";
  208. public static readonly DerObjectIdentifier IdSpqEtsUri = new DerObjectIdentifier(IdSpq + ".1");
  209. public static readonly DerObjectIdentifier IdSpqEtsUNotice = new DerObjectIdentifier(IdSpq + ".2");
  210. //
  211. // pkcs-12 OBJECT IDENTIFIER ::= {
  212. // iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 12 }
  213. //
  214. public const string Pkcs12 = "1.2.840.113549.1.12";
  215. public const string BagTypes = Pkcs12 + ".10.1";
  216. public static readonly DerObjectIdentifier KeyBag = new DerObjectIdentifier(BagTypes + ".1");
  217. public static readonly DerObjectIdentifier Pkcs8ShroudedKeyBag = new DerObjectIdentifier(BagTypes + ".2");
  218. public static readonly DerObjectIdentifier CertBag = new DerObjectIdentifier(BagTypes + ".3");
  219. public static readonly DerObjectIdentifier CrlBag = new DerObjectIdentifier(BagTypes + ".4");
  220. public static readonly DerObjectIdentifier SecretBag = new DerObjectIdentifier(BagTypes + ".5");
  221. public static readonly DerObjectIdentifier SafeContentsBag = new DerObjectIdentifier(BagTypes + ".6");
  222. public const string Pkcs12PbeIds = Pkcs12 + ".1";
  223. public static readonly DerObjectIdentifier PbeWithShaAnd128BitRC4 = new DerObjectIdentifier(Pkcs12PbeIds + ".1");
  224. public static readonly DerObjectIdentifier PbeWithShaAnd40BitRC4 = new DerObjectIdentifier(Pkcs12PbeIds + ".2");
  225. public static readonly DerObjectIdentifier PbeWithShaAnd3KeyTripleDesCbc = new DerObjectIdentifier(Pkcs12PbeIds + ".3");
  226. public static readonly DerObjectIdentifier PbeWithShaAnd2KeyTripleDesCbc = new DerObjectIdentifier(Pkcs12PbeIds + ".4");
  227. public static readonly DerObjectIdentifier PbeWithShaAnd128BitRC2Cbc = new DerObjectIdentifier(Pkcs12PbeIds + ".5");
  228. public static readonly DerObjectIdentifier PbewithShaAnd40BitRC2Cbc = new DerObjectIdentifier(Pkcs12PbeIds + ".6");
  229. }
  230. }
  231. #endif