@ne1410s/crypto 0.2.62 → 0.2.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -164,36 +164,36 @@ function csr(params) {
164
164
  pkcs10 = new pkijs.CertificationRequest();
165
165
  pkcs10.version = 0;
166
166
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
167
- type: '2.5.4.3',
167
+ type: '2.5.4.3', // CN=
168
168
  value: new asn1js__namespace.PrintableString({ value: params.domains[0] }),
169
169
  }));
170
170
  if (params.country) {
171
171
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
172
- type: '2.5.4.6',
172
+ type: '2.5.4.6', // C=
173
173
  value: new asn1js__namespace.PrintableString({ value: params.country }),
174
174
  }));
175
175
  }
176
176
  if (params.town) {
177
177
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
178
- type: '2.5.4.7',
178
+ type: '2.5.4.7', // L=
179
179
  value: new asn1js__namespace.PrintableString({ value: params.town }),
180
180
  }));
181
181
  }
182
182
  if (params.county) {
183
183
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
184
- type: '2.5.4.8',
184
+ type: '2.5.4.8', // S=
185
185
  value: new asn1js__namespace.PrintableString({ value: params.county }),
186
186
  }));
187
187
  }
188
188
  if (params.company) {
189
189
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
190
- type: '2.5.4.10',
190
+ type: '2.5.4.10', // O=
191
191
  value: new asn1js__namespace.PrintableString({ value: params.company }),
192
192
  }));
193
193
  }
194
194
  if (params.department) {
195
195
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
196
- type: '2.5.4.11',
196
+ type: '2.5.4.11', // OU=
197
197
  value: new asn1js__namespace.PrintableString({ value: params.department }),
198
198
  }));
199
199
  }
@@ -211,7 +211,7 @@ function csr(params) {
211
211
  //pubkeyhash_sha256 = await crypto.subtle.digest('SHA-256', toDigest);
212
212
  pkcs10.attributes = [];
213
213
  pkcs10.attributes.push(new pkijs.Attribute({
214
- type: '1.2.840.113549.1.9.14',
214
+ type: '1.2.840.113549.1.9.14', // pkcs-9-at-extensionRequest
215
215
  values: [
216
216
  new pkijs.Extensions({
217
217
  extensions: [
@@ -273,12 +273,12 @@ function pfx(friendlyName, cert_b64, key_b64, password, hash) {
273
273
  objc_cer = new pkijs.Certificate({ schema: asn1_cer.result }), objc_key = new pkijs.PrivateKeyInfo({ schema: asn1_key.result });
274
274
  pkcs12 = new pkijs.PFX({
275
275
  parsedValue: {
276
- integrityMode: 0,
276
+ integrityMode: 0, // Password-Based Integrity Mode
277
277
  authenticatedSafe: new pkijs.AuthenticatedSafe({
278
278
  parsedValue: {
279
279
  safeContents: [
280
280
  {
281
- privacyMode: 0,
281
+ privacyMode: 0, // 'No Privacy' mode
282
282
  value: new pkijs.SafeContents({
283
283
  safeBags: [
284
284
  new pkijs.SafeBag({
@@ -292,7 +292,7 @@ function pfx(friendlyName, cert_b64, key_b64, password, hash) {
292
292
  }),
293
293
  bagAttributes: [
294
294
  new pkijs.Attribute({
295
- type: '1.2.840.113549.1.9.20',
295
+ type: '1.2.840.113549.1.9.20', // friendlyName
296
296
  values: [new asn1js__namespace.BmpString({ value: friendlyName })],
297
297
  }),
298
298
  ],
@@ -142,36 +142,36 @@ function csr(params) {
142
142
  pkcs10 = new pkijs.CertificationRequest();
143
143
  pkcs10.version = 0;
144
144
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
145
- type: '2.5.4.3',
145
+ type: '2.5.4.3', // CN=
146
146
  value: new asn1js.PrintableString({ value: params.domains[0] }),
147
147
  }));
148
148
  if (params.country) {
149
149
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
150
- type: '2.5.4.6',
150
+ type: '2.5.4.6', // C=
151
151
  value: new asn1js.PrintableString({ value: params.country }),
152
152
  }));
153
153
  }
154
154
  if (params.town) {
155
155
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
156
- type: '2.5.4.7',
156
+ type: '2.5.4.7', // L=
157
157
  value: new asn1js.PrintableString({ value: params.town }),
158
158
  }));
159
159
  }
160
160
  if (params.county) {
161
161
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
162
- type: '2.5.4.8',
162
+ type: '2.5.4.8', // S=
163
163
  value: new asn1js.PrintableString({ value: params.county }),
164
164
  }));
165
165
  }
166
166
  if (params.company) {
167
167
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
168
- type: '2.5.4.10',
168
+ type: '2.5.4.10', // O=
169
169
  value: new asn1js.PrintableString({ value: params.company }),
170
170
  }));
171
171
  }
172
172
  if (params.department) {
173
173
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
174
- type: '2.5.4.11',
174
+ type: '2.5.4.11', // OU=
175
175
  value: new asn1js.PrintableString({ value: params.department }),
176
176
  }));
177
177
  }
@@ -189,7 +189,7 @@ function csr(params) {
189
189
  //pubkeyhash_sha256 = await crypto.subtle.digest('SHA-256', toDigest);
190
190
  pkcs10.attributes = [];
191
191
  pkcs10.attributes.push(new pkijs.Attribute({
192
- type: '1.2.840.113549.1.9.14',
192
+ type: '1.2.840.113549.1.9.14', // pkcs-9-at-extensionRequest
193
193
  values: [
194
194
  new pkijs.Extensions({
195
195
  extensions: [
@@ -251,12 +251,12 @@ function pfx(friendlyName, cert_b64, key_b64, password, hash) {
251
251
  objc_cer = new pkijs.Certificate({ schema: asn1_cer.result }), objc_key = new pkijs.PrivateKeyInfo({ schema: asn1_key.result });
252
252
  pkcs12 = new pkijs.PFX({
253
253
  parsedValue: {
254
- integrityMode: 0,
254
+ integrityMode: 0, // Password-Based Integrity Mode
255
255
  authenticatedSafe: new pkijs.AuthenticatedSafe({
256
256
  parsedValue: {
257
257
  safeContents: [
258
258
  {
259
- privacyMode: 0,
259
+ privacyMode: 0, // 'No Privacy' mode
260
260
  value: new pkijs.SafeContents({
261
261
  safeBags: [
262
262
  new pkijs.SafeBag({
@@ -270,7 +270,7 @@ function pfx(friendlyName, cert_b64, key_b64, password, hash) {
270
270
  }),
271
271
  bagAttributes: [
272
272
  new pkijs.Attribute({
273
- type: '1.2.840.113549.1.9.20',
273
+ type: '1.2.840.113549.1.9.20', // friendlyName
274
274
  values: [new asn1js.BmpString({ value: friendlyName })],
275
275
  }),
276
276
  ],
@@ -3429,36 +3429,36 @@
3429
3429
  pkcs10 = new pkijs.CertificationRequest();
3430
3430
  pkcs10.version = 0;
3431
3431
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
3432
- type: '2.5.4.3',
3432
+ type: '2.5.4.3', // CN=
3433
3433
  value: new PrintableString({ value: params.domains[0] }),
3434
3434
  }));
3435
3435
  if (params.country) {
3436
3436
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
3437
- type: '2.5.4.6',
3437
+ type: '2.5.4.6', // C=
3438
3438
  value: new PrintableString({ value: params.country }),
3439
3439
  }));
3440
3440
  }
3441
3441
  if (params.town) {
3442
3442
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
3443
- type: '2.5.4.7',
3443
+ type: '2.5.4.7', // L=
3444
3444
  value: new PrintableString({ value: params.town }),
3445
3445
  }));
3446
3446
  }
3447
3447
  if (params.county) {
3448
3448
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
3449
- type: '2.5.4.8',
3449
+ type: '2.5.4.8', // S=
3450
3450
  value: new PrintableString({ value: params.county }),
3451
3451
  }));
3452
3452
  }
3453
3453
  if (params.company) {
3454
3454
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
3455
- type: '2.5.4.10',
3455
+ type: '2.5.4.10', // O=
3456
3456
  value: new PrintableString({ value: params.company }),
3457
3457
  }));
3458
3458
  }
3459
3459
  if (params.department) {
3460
3460
  pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
3461
- type: '2.5.4.11',
3461
+ type: '2.5.4.11', // OU=
3462
3462
  value: new PrintableString({ value: params.department }),
3463
3463
  }));
3464
3464
  }
@@ -3476,7 +3476,7 @@
3476
3476
  //pubkeyhash_sha256 = await crypto.subtle.digest('SHA-256', toDigest);
3477
3477
  pkcs10.attributes = [];
3478
3478
  pkcs10.attributes.push(new pkijs.Attribute({
3479
- type: '1.2.840.113549.1.9.14',
3479
+ type: '1.2.840.113549.1.9.14', // pkcs-9-at-extensionRequest
3480
3480
  values: [
3481
3481
  new pkijs.Extensions({
3482
3482
  extensions: [
@@ -3538,12 +3538,12 @@
3538
3538
  objc_cer = new pkijs.Certificate({ schema: asn1_cer.result }), objc_key = new pkijs.PrivateKeyInfo({ schema: asn1_key.result });
3539
3539
  pkcs12 = new pkijs.PFX({
3540
3540
  parsedValue: {
3541
- integrityMode: 0,
3541
+ integrityMode: 0, // Password-Based Integrity Mode
3542
3542
  authenticatedSafe: new pkijs.AuthenticatedSafe({
3543
3543
  parsedValue: {
3544
3544
  safeContents: [
3545
3545
  {
3546
- privacyMode: 0,
3546
+ privacyMode: 0, // 'No Privacy' mode
3547
3547
  value: new pkijs.SafeContents({
3548
3548
  safeBags: [
3549
3549
  new pkijs.SafeBag({
@@ -3557,7 +3557,7 @@
3557
3557
  }),
3558
3558
  bagAttributes: [
3559
3559
  new pkijs.Attribute({
3560
- type: '1.2.840.113549.1.9.20',
3560
+ type: '1.2.840.113549.1.9.20', // friendlyName
3561
3561
  values: [new BmpString({ value: friendlyName })],
3562
3562
  }),
3563
3563
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ne1410s/crypto",
3
- "version": "0.2.62",
3
+ "version": "0.2.64",
4
4
  "description": "Lightweight ES5 script to provide crypto utilities",
5
5
  "main": "dist/ne14_crypto.cjs.min.js",
6
6
  "module": "dist/ne14_crypto.esm.min.js",
@@ -40,18 +40,18 @@
40
40
  "devDependencies": {
41
41
  "@rollup/plugin-commonjs": "^25.0.7",
42
42
  "@rollup/plugin-node-resolve": "^15.2.3",
43
- "@types/node": "^20.9.2",
43
+ "@types/node": "^20.9.4",
44
44
  "@types/pkijs": "^3.0.1",
45
45
  "chai": "^4.3.10",
46
46
  "mocha": "^10.2.0",
47
47
  "prettier": "^3.1.0",
48
48
  "rimraf": "^5.0.5",
49
- "rollup": "^4.5.0",
49
+ "rollup": "^4.5.1",
50
50
  "rollup-plugin-typescript2": "^0.36.0",
51
- "typescript": "^5.2.2"
51
+ "typescript": "^5.3.2"
52
52
  },
53
53
  "dependencies": {
54
- "@ne1410s/text": "^0.3.24",
54
+ "@ne1410s/text": "^0.3.26",
55
55
  "asn1js": "^3.0.5",
56
56
  "pkijs": "^3.0.15"
57
57
  }