1 | /**
|
---|
2 | * Object IDs for ASN.1.
|
---|
3 | *
|
---|
4 | * @author Dave Longley
|
---|
5 | *
|
---|
6 | * Copyright (c) 2010-2013 Digital Bazaar, Inc.
|
---|
7 | */
|
---|
8 | var forge = require('./forge');
|
---|
9 |
|
---|
10 | forge.pki = forge.pki || {};
|
---|
11 | var oids = module.exports = forge.pki.oids = forge.oids = forge.oids || {};
|
---|
12 |
|
---|
13 | // set id to name mapping and name to id mapping
|
---|
14 | function _IN(id, name) {
|
---|
15 | oids[id] = name;
|
---|
16 | oids[name] = id;
|
---|
17 | }
|
---|
18 | // set id to name mapping only
|
---|
19 | function _I_(id, name) {
|
---|
20 | oids[id] = name;
|
---|
21 | }
|
---|
22 |
|
---|
23 | // algorithm OIDs
|
---|
24 | _IN('1.2.840.113549.1.1.1', 'rsaEncryption');
|
---|
25 | // Note: md2 & md4 not implemented
|
---|
26 | //_IN('1.2.840.113549.1.1.2', 'md2WithRSAEncryption');
|
---|
27 | //_IN('1.2.840.113549.1.1.3', 'md4WithRSAEncryption');
|
---|
28 | _IN('1.2.840.113549.1.1.4', 'md5WithRSAEncryption');
|
---|
29 | _IN('1.2.840.113549.1.1.5', 'sha1WithRSAEncryption');
|
---|
30 | _IN('1.2.840.113549.1.1.7', 'RSAES-OAEP');
|
---|
31 | _IN('1.2.840.113549.1.1.8', 'mgf1');
|
---|
32 | _IN('1.2.840.113549.1.1.9', 'pSpecified');
|
---|
33 | _IN('1.2.840.113549.1.1.10', 'RSASSA-PSS');
|
---|
34 | _IN('1.2.840.113549.1.1.11', 'sha256WithRSAEncryption');
|
---|
35 | _IN('1.2.840.113549.1.1.12', 'sha384WithRSAEncryption');
|
---|
36 | _IN('1.2.840.113549.1.1.13', 'sha512WithRSAEncryption');
|
---|
37 | // Edwards-curve Digital Signature Algorithm (EdDSA) Ed25519
|
---|
38 | _IN('1.3.101.112', 'EdDSA25519');
|
---|
39 |
|
---|
40 | _IN('1.2.840.10040.4.3', 'dsa-with-sha1');
|
---|
41 |
|
---|
42 | _IN('1.3.14.3.2.7', 'desCBC');
|
---|
43 |
|
---|
44 | _IN('1.3.14.3.2.26', 'sha1');
|
---|
45 | _IN('2.16.840.1.101.3.4.2.1', 'sha256');
|
---|
46 | _IN('2.16.840.1.101.3.4.2.2', 'sha384');
|
---|
47 | _IN('2.16.840.1.101.3.4.2.3', 'sha512');
|
---|
48 | _IN('1.2.840.113549.2.5', 'md5');
|
---|
49 |
|
---|
50 | // pkcs#7 content types
|
---|
51 | _IN('1.2.840.113549.1.7.1', 'data');
|
---|
52 | _IN('1.2.840.113549.1.7.2', 'signedData');
|
---|
53 | _IN('1.2.840.113549.1.7.3', 'envelopedData');
|
---|
54 | _IN('1.2.840.113549.1.7.4', 'signedAndEnvelopedData');
|
---|
55 | _IN('1.2.840.113549.1.7.5', 'digestedData');
|
---|
56 | _IN('1.2.840.113549.1.7.6', 'encryptedData');
|
---|
57 |
|
---|
58 | // pkcs#9 oids
|
---|
59 | _IN('1.2.840.113549.1.9.1', 'emailAddress');
|
---|
60 | _IN('1.2.840.113549.1.9.2', 'unstructuredName');
|
---|
61 | _IN('1.2.840.113549.1.9.3', 'contentType');
|
---|
62 | _IN('1.2.840.113549.1.9.4', 'messageDigest');
|
---|
63 | _IN('1.2.840.113549.1.9.5', 'signingTime');
|
---|
64 | _IN('1.2.840.113549.1.9.6', 'counterSignature');
|
---|
65 | _IN('1.2.840.113549.1.9.7', 'challengePassword');
|
---|
66 | _IN('1.2.840.113549.1.9.8', 'unstructuredAddress');
|
---|
67 | _IN('1.2.840.113549.1.9.14', 'extensionRequest');
|
---|
68 |
|
---|
69 | _IN('1.2.840.113549.1.9.20', 'friendlyName');
|
---|
70 | _IN('1.2.840.113549.1.9.21', 'localKeyId');
|
---|
71 | _IN('1.2.840.113549.1.9.22.1', 'x509Certificate');
|
---|
72 |
|
---|
73 | // pkcs#12 safe bags
|
---|
74 | _IN('1.2.840.113549.1.12.10.1.1', 'keyBag');
|
---|
75 | _IN('1.2.840.113549.1.12.10.1.2', 'pkcs8ShroudedKeyBag');
|
---|
76 | _IN('1.2.840.113549.1.12.10.1.3', 'certBag');
|
---|
77 | _IN('1.2.840.113549.1.12.10.1.4', 'crlBag');
|
---|
78 | _IN('1.2.840.113549.1.12.10.1.5', 'secretBag');
|
---|
79 | _IN('1.2.840.113549.1.12.10.1.6', 'safeContentsBag');
|
---|
80 |
|
---|
81 | // password-based-encryption for pkcs#12
|
---|
82 | _IN('1.2.840.113549.1.5.13', 'pkcs5PBES2');
|
---|
83 | _IN('1.2.840.113549.1.5.12', 'pkcs5PBKDF2');
|
---|
84 |
|
---|
85 | _IN('1.2.840.113549.1.12.1.1', 'pbeWithSHAAnd128BitRC4');
|
---|
86 | _IN('1.2.840.113549.1.12.1.2', 'pbeWithSHAAnd40BitRC4');
|
---|
87 | _IN('1.2.840.113549.1.12.1.3', 'pbeWithSHAAnd3-KeyTripleDES-CBC');
|
---|
88 | _IN('1.2.840.113549.1.12.1.4', 'pbeWithSHAAnd2-KeyTripleDES-CBC');
|
---|
89 | _IN('1.2.840.113549.1.12.1.5', 'pbeWithSHAAnd128BitRC2-CBC');
|
---|
90 | _IN('1.2.840.113549.1.12.1.6', 'pbewithSHAAnd40BitRC2-CBC');
|
---|
91 |
|
---|
92 | // hmac OIDs
|
---|
93 | _IN('1.2.840.113549.2.7', 'hmacWithSHA1');
|
---|
94 | _IN('1.2.840.113549.2.8', 'hmacWithSHA224');
|
---|
95 | _IN('1.2.840.113549.2.9', 'hmacWithSHA256');
|
---|
96 | _IN('1.2.840.113549.2.10', 'hmacWithSHA384');
|
---|
97 | _IN('1.2.840.113549.2.11', 'hmacWithSHA512');
|
---|
98 |
|
---|
99 | // symmetric key algorithm oids
|
---|
100 | _IN('1.2.840.113549.3.7', 'des-EDE3-CBC');
|
---|
101 | _IN('2.16.840.1.101.3.4.1.2', 'aes128-CBC');
|
---|
102 | _IN('2.16.840.1.101.3.4.1.22', 'aes192-CBC');
|
---|
103 | _IN('2.16.840.1.101.3.4.1.42', 'aes256-CBC');
|
---|
104 |
|
---|
105 | // certificate issuer/subject OIDs
|
---|
106 | _IN('2.5.4.3', 'commonName');
|
---|
107 | _IN('2.5.4.5', 'serialName');
|
---|
108 | _IN('2.5.4.6', 'countryName');
|
---|
109 | _IN('2.5.4.7', 'localityName');
|
---|
110 | _IN('2.5.4.8', 'stateOrProvinceName');
|
---|
111 | _IN('2.5.4.9', 'streetAddress');
|
---|
112 | _IN('2.5.4.10', 'organizationName');
|
---|
113 | _IN('2.5.4.11', 'organizationalUnitName');
|
---|
114 | _IN('2.5.4.13', 'description');
|
---|
115 | _IN('2.5.4.15', 'businessCategory');
|
---|
116 | _IN('2.5.4.17', 'postalCode');
|
---|
117 | _IN('1.3.6.1.4.1.311.60.2.1.2', 'jurisdictionOfIncorporationStateOrProvinceName');
|
---|
118 | _IN('1.3.6.1.4.1.311.60.2.1.3', 'jurisdictionOfIncorporationCountryName');
|
---|
119 |
|
---|
120 | // X.509 extension OIDs
|
---|
121 | _IN('2.16.840.1.113730.1.1', 'nsCertType');
|
---|
122 | _IN('2.16.840.1.113730.1.13', 'nsComment'); // deprecated in theory; still widely used
|
---|
123 | _I_('2.5.29.1', 'authorityKeyIdentifier'); // deprecated, use .35
|
---|
124 | _I_('2.5.29.2', 'keyAttributes'); // obsolete use .37 or .15
|
---|
125 | _I_('2.5.29.3', 'certificatePolicies'); // deprecated, use .32
|
---|
126 | _I_('2.5.29.4', 'keyUsageRestriction'); // obsolete use .37 or .15
|
---|
127 | _I_('2.5.29.5', 'policyMapping'); // deprecated use .33
|
---|
128 | _I_('2.5.29.6', 'subtreesConstraint'); // obsolete use .30
|
---|
129 | _I_('2.5.29.7', 'subjectAltName'); // deprecated use .17
|
---|
130 | _I_('2.5.29.8', 'issuerAltName'); // deprecated use .18
|
---|
131 | _I_('2.5.29.9', 'subjectDirectoryAttributes');
|
---|
132 | _I_('2.5.29.10', 'basicConstraints'); // deprecated use .19
|
---|
133 | _I_('2.5.29.11', 'nameConstraints'); // deprecated use .30
|
---|
134 | _I_('2.5.29.12', 'policyConstraints'); // deprecated use .36
|
---|
135 | _I_('2.5.29.13', 'basicConstraints'); // deprecated use .19
|
---|
136 | _IN('2.5.29.14', 'subjectKeyIdentifier');
|
---|
137 | _IN('2.5.29.15', 'keyUsage');
|
---|
138 | _I_('2.5.29.16', 'privateKeyUsagePeriod');
|
---|
139 | _IN('2.5.29.17', 'subjectAltName');
|
---|
140 | _IN('2.5.29.18', 'issuerAltName');
|
---|
141 | _IN('2.5.29.19', 'basicConstraints');
|
---|
142 | _I_('2.5.29.20', 'cRLNumber');
|
---|
143 | _I_('2.5.29.21', 'cRLReason');
|
---|
144 | _I_('2.5.29.22', 'expirationDate');
|
---|
145 | _I_('2.5.29.23', 'instructionCode');
|
---|
146 | _I_('2.5.29.24', 'invalidityDate');
|
---|
147 | _I_('2.5.29.25', 'cRLDistributionPoints'); // deprecated use .31
|
---|
148 | _I_('2.5.29.26', 'issuingDistributionPoint'); // deprecated use .28
|
---|
149 | _I_('2.5.29.27', 'deltaCRLIndicator');
|
---|
150 | _I_('2.5.29.28', 'issuingDistributionPoint');
|
---|
151 | _I_('2.5.29.29', 'certificateIssuer');
|
---|
152 | _I_('2.5.29.30', 'nameConstraints');
|
---|
153 | _IN('2.5.29.31', 'cRLDistributionPoints');
|
---|
154 | _IN('2.5.29.32', 'certificatePolicies');
|
---|
155 | _I_('2.5.29.33', 'policyMappings');
|
---|
156 | _I_('2.5.29.34', 'policyConstraints'); // deprecated use .36
|
---|
157 | _IN('2.5.29.35', 'authorityKeyIdentifier');
|
---|
158 | _I_('2.5.29.36', 'policyConstraints');
|
---|
159 | _IN('2.5.29.37', 'extKeyUsage');
|
---|
160 | _I_('2.5.29.46', 'freshestCRL');
|
---|
161 | _I_('2.5.29.54', 'inhibitAnyPolicy');
|
---|
162 |
|
---|
163 | // extKeyUsage purposes
|
---|
164 | _IN('1.3.6.1.4.1.11129.2.4.2', 'timestampList');
|
---|
165 | _IN('1.3.6.1.5.5.7.1.1', 'authorityInfoAccess');
|
---|
166 | _IN('1.3.6.1.5.5.7.3.1', 'serverAuth');
|
---|
167 | _IN('1.3.6.1.5.5.7.3.2', 'clientAuth');
|
---|
168 | _IN('1.3.6.1.5.5.7.3.3', 'codeSigning');
|
---|
169 | _IN('1.3.6.1.5.5.7.3.4', 'emailProtection');
|
---|
170 | _IN('1.3.6.1.5.5.7.3.8', 'timeStamping');
|
---|