@unabandoned/parse-asn1 5.2.0

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.
Files changed (57) hide show
  1. package/.githooks/commit-msg +2 -0
  2. package/.github/FUNDING.yml +12 -0
  3. package/.github/workflows/ci.yml +13 -0
  4. package/.github/workflows/codeql.yml +14 -0
  5. package/.github/workflows/commitlint.yml +8 -0
  6. package/.github/workflows/publish.yml +16 -0
  7. package/.github/workflows/release-cut.yml +12 -0
  8. package/.github/workflows/release-please.yml +11 -0
  9. package/.github/workflows/release-security.yml +11 -0
  10. package/.github/workflows/renovate-config.yml +10 -0
  11. package/.github/workflows/scorecard.yml +14 -0
  12. package/.release-please-manifest.json +3 -0
  13. package/.unabandoned.yml +30 -0
  14. package/CHANGELOG.md +216 -0
  15. package/LICENSE +13 -0
  16. package/README.md +15 -0
  17. package/aesid.json +13 -0
  18. package/asn1.js +123 -0
  19. package/certificate.js +89 -0
  20. package/commitlint.config.js +1 -0
  21. package/evp-bytes-to-key.js +56 -0
  22. package/fixProc.js +33 -0
  23. package/index.js +111 -0
  24. package/package.json +46 -0
  25. package/release-please-config.json +24 -0
  26. package/renovate.json +7 -0
  27. package/test/1024.priv +16 -0
  28. package/test/1024.pub +6 -0
  29. package/test/cert.priv +27 -0
  30. package/test/cert.pub +20 -0
  31. package/test/dsa.1024.priv +18 -0
  32. package/test/dsa.1024.pub +12 -0
  33. package/test/dsa.2048.priv +20 -0
  34. package/test/dsa.2048.pub +20 -0
  35. package/test/ec.pass.priv +7 -0
  36. package/test/ec.priv +5 -0
  37. package/test/ec.pub +4 -0
  38. package/test/index.js +108 -0
  39. package/test/node.cert +20 -0
  40. package/test/pass.1024.priv +18 -0
  41. package/test/pass.1024.pub +6 -0
  42. package/test/pass.dsa.1024.priv +11 -0
  43. package/test/pass.dsa.1024.pub +12 -0
  44. package/test/pass.rsa.1024.priv +18 -0
  45. package/test/pass.rsa.1024.pub +6 -0
  46. package/test/pass.rsa.2028.priv +30 -0
  47. package/test/pass.rsa.2028.pub +9 -0
  48. package/test/pass2.dsa.1024.priv +15 -0
  49. package/test/pass2.dsa.1024.pub +12 -0
  50. package/test/rsa.1024.priv +15 -0
  51. package/test/rsa.1024.pub +5 -0
  52. package/test/rsa.2028.priv +27 -0
  53. package/test/rsa.2028.pub +8 -0
  54. package/test/tape.js +134 -0
  55. package/test/vector.js +11 -0
  56. package/test/vector.priv +12 -0
  57. package/test/vector2.priv +19 -0
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ npx --no-install commitlint --edit "$1"
@@ -0,0 +1,12 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: [ljharb]
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: # Replace with a single Ko-fi username
7
+ tidelift: npm/parse-asn1
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,13 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ pull_request:
6
+ jobs:
7
+ ci:
8
+ permissions:
9
+ contents: read
10
+ uses: unabandoned/.github/.github/workflows/reusable-ci.yml@bd9eb6bfc5a567b272e0c6f05703a726a2655531 # v1.1.0
11
+ with:
12
+ node-versions: '[20, 22, 24]'
13
+ has-build: false
@@ -0,0 +1,14 @@
1
+ name: CodeQL
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ pull_request:
6
+ schedule:
7
+ - cron: '0 6 * * 1'
8
+ jobs:
9
+ codeql:
10
+ permissions:
11
+ actions: read
12
+ contents: read
13
+ security-events: write
14
+ uses: unabandoned/.github/.github/workflows/reusable-codeql.yml@bd9eb6bfc5a567b272e0c6f05703a726a2655531 # v1.1.0
@@ -0,0 +1,8 @@
1
+ name: commitlint
2
+ on:
3
+ pull_request:
4
+ jobs:
5
+ commitlint:
6
+ permissions:
7
+ contents: read
8
+ uses: unabandoned/.github/.github/workflows/reusable-commitlint.yml@bd9eb6bfc5a567b272e0c6f05703a726a2655531 # v1.1.0
@@ -0,0 +1,16 @@
1
+ name: publish
2
+ on:
3
+ release:
4
+ types: [published]
5
+ permissions:
6
+ contents: read
7
+ id-token: write # required for OIDC on the calling job
8
+ jobs:
9
+ publish:
10
+ permissions:
11
+ contents: read
12
+ id-token: write
13
+ uses: unabandoned/.github/.github/workflows/reusable-publish.yml@bd9eb6bfc5a567b272e0c6f05703a726a2655531 # v1.1.0
14
+ with:
15
+ install-for-publish: false
16
+ secrets: inherit
@@ -0,0 +1,12 @@
1
+ name: release-cut
2
+ on:
3
+ schedule:
4
+ - cron: '0 6 1 * *'
5
+ workflow_dispatch:
6
+ jobs:
7
+ cut:
8
+ permissions:
9
+ contents: write
10
+ pull-requests: write
11
+ uses: unabandoned/.github/.github/workflows/reusable-release-cut.yml@bd9eb6bfc5a567b272e0c6f05703a726a2655531 # v1.1.0
12
+ secrets: inherit
@@ -0,0 +1,11 @@
1
+ name: release-please
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ jobs:
6
+ release-please:
7
+ permissions:
8
+ contents: write
9
+ pull-requests: write
10
+ uses: unabandoned/.github/.github/workflows/reusable-release-please.yml@bd9eb6bfc5a567b272e0c6f05703a726a2655531 # v1.1.0
11
+ secrets: inherit
@@ -0,0 +1,11 @@
1
+ name: release-security
2
+ on:
3
+ pull_request:
4
+ types: [closed]
5
+ jobs:
6
+ security-release:
7
+ permissions:
8
+ contents: write
9
+ pull-requests: write
10
+ uses: unabandoned/.github/.github/workflows/reusable-release-security.yml@bd9eb6bfc5a567b272e0c6f05703a726a2655531 # v1.1.0
11
+ secrets: inherit
@@ -0,0 +1,10 @@
1
+ name: Renovate Config
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ pull_request:
6
+ jobs:
7
+ renovate-config:
8
+ permissions:
9
+ contents: read
10
+ uses: unabandoned/.github/.github/workflows/reusable-renovate-config.yml@bd9eb6bfc5a567b272e0c6f05703a726a2655531 # v1.1.0
@@ -0,0 +1,14 @@
1
+ name: Scorecard
2
+ on:
3
+ branch_protection_rule:
4
+ schedule:
5
+ - cron: '0 6 * * 1'
6
+ push:
7
+ branches: [master]
8
+ jobs:
9
+ scorecard:
10
+ permissions:
11
+ security-events: write
12
+ id-token: write
13
+ contents: read
14
+ uses: unabandoned/.github/.github/workflows/reusable-scorecard.yml@bd9eb6bfc5a567b272e0c6f05703a726a2655531 # v1.1.0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "5.2.0"
3
+ }
@@ -0,0 +1,30 @@
1
+ schema: 1
2
+
3
+ package: "@unabandoned/parse-asn1"
4
+
5
+ upstream:
6
+ repo: crypto-browserify/parse-asn1
7
+ reason: >-
8
+ released 2025-09-24 and about to cross the abandonment threshold, while
9
+ shipping evp_bytestokey (2017) and pinning asn1.js to a major behind
10
+
11
+ summary: >-
12
+ Parses RSA, DSA and EC private and public keys out of PEM and DER, including
13
+ the encrypted PKCS#8 forms, and hands back the components signing needs.
14
+
15
+ why-forked: >-
16
+ It was the last path by which dead packages re-entered our trees: through it
17
+ @unabandoned/crypto-browserify pulled upstream browserify-aes 1.2.0, and with
18
+ it buffer-xor, create-hash and evp_bytestokey. Upstream is not abandoned by
19
+ the calendar, but it carries 2017 packages and pins asn1.js a major behind,
20
+ which leaves consumers holding the rot either way.
21
+
22
+ status: active
23
+
24
+ used-by:
25
+ - consumer: "@unabandoned/browserify-sign"
26
+ purpose: "Reads the private key before signing and the public key before verifying."
27
+ - consumer: "@unabandoned/crypto-browserify"
28
+ purpose: "Key parsing behind publicEncrypt and privateDecrypt."
29
+
30
+ tags: [asn1, pem, der, keys, crypto]
package/CHANGELOG.md ADDED
@@ -0,0 +1,216 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [5.2.0](https://github.com/unabandoned/parse-asn1/compare/parse-asn1-v5.1.9...parse-asn1-v5.2.0) (2026-09-22)
9
+
10
+
11
+ ### Features
12
+
13
+ * onboard as @unabandoned/parse-asn1 ([#1](https://github.com/unabandoned/parse-asn1/issues/1)) ([2386665](https://github.com/unabandoned/parse-asn1/commit/2386665910c08f2d4d6a9718e20c5857182d3e17))
14
+
15
+ ## [v5.1.9](https://github.com/browserify/parse-asn1/compare/v5.1.8...v5.1.9) - 2025-09-24
16
+
17
+ ### Commits
18
+
19
+ - [meta] node 0.10 works now [`4596fae`](https://github.com/browserify/parse-asn1/commit/4596fae4ba80df5db0f335a400fc53d22b307633)
20
+ - [Deps] update `pbkdf2` [`6ef651a`](https://github.com/browserify/parse-asn1/commit/6ef651a9e6373e6e09c71330ea4a4cac4329c009)
21
+
22
+ ## [v5.1.8](https://github.com/browserify/parse-asn1/compare/v5.1.7...v5.1.8) - 2025-09-22
23
+
24
+ ### Commits
25
+
26
+ - [actions] split out node 10-20, and 20+ [`e186dbf`](https://github.com/browserify/parse-asn1/commit/e186dbf58216c9013b560f3f9627347985abd202)
27
+ - [meta] raise engines.node to match dep graph [`29d1def`](https://github.com/browserify/parse-asn1/commit/29d1defdaf3fc113069347a2edd284d118a73775)
28
+ - [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `tape` [`2648018`](https://github.com/browserify/parse-asn1/commit/264801813422e4f88ba1834e40e026cdf6bf3f30)
29
+ - [Deps] update `hash-base`, `pbkdf2` [`3ce78af`](https://github.com/browserify/parse-asn1/commit/3ce78af3720c95a71e1f264ebb20e8af63ad00bc)
30
+ - [Tests] replace `aud` with `npm audit` [`5ea1506`](https://github.com/browserify/parse-asn1/commit/5ea1506b28cb7c4f976ddb89877c0fe92d183ec9)
31
+ - [Tests] fix tests in node `4.0 - 4.4 | 5.0 - 5.9` [`4d24a07`](https://github.com/browserify/parse-asn1/commit/4d24a070402332083357da4edcacbee9d98e9dd5)
32
+ - [meta] add proper `npm version` npmrc settings [`f5d7025`](https://github.com/browserify/parse-asn1/commit/f5d702582d762e96a7deb7338a398a32224e9424)
33
+ - [Deps] remove unused `hash-base` dep [`93663af`](https://github.com/browserify/parse-asn1/commit/93663af2ba632c5a4c76847d410836ca8da3f00b)
34
+ - [Dev Deps] add missing peer dep [`f3e9076`](https://github.com/browserify/parse-asn1/commit/f3e9076f00bd43bacc283979bfb3c390e8414580)
35
+
36
+ ## [v5.1.7](https://github.com/browserify/parse-asn1/compare/v5.1.6...v5.1.7) - 2024-03-05
37
+
38
+ ### Commits
39
+
40
+ - [eslint] switch from standard to eslint [`794cf67`](https://github.com/browserify/parse-asn1/commit/794cf67208a69d4cc855f784a299906c6d6ef671)
41
+ - [meta] add `auto-changelog` [`8961374`](https://github.com/browserify/parse-asn1/commit/89613740568d94746d45adf8d1af029922ab9d54)
42
+ - [Tests] migrate from travis to github actions [`fdbdda5`](https://github.com/browserify/parse-asn1/commit/fdbdda5eeeaec0aeb8a740fa49deb449a47390ab)
43
+ - [meta] fix package.json indentation [`60eb8f3`](https://github.com/browserify/parse-asn1/commit/60eb8f3e2bd9e91dca0e9fd5e617864cde35cb35)
44
+ - [meta] switch from files to npmignore [`e41c881`](https://github.com/browserify/parse-asn1/commit/e41c881bf4cbf97609a82bfe4bfde4fdfcf54e39)
45
+ - [Tests] Buffer.from requires node >= 4 [`0f9ba08`](https://github.com/browserify/parse-asn1/commit/0f9ba08be2b626fc4d8d01dd96916c1dbd6a8fb7)
46
+ - [Deps] update `browserify-aes`, `evp_bytestokey`, `pbkdf2`, `safe-buffer` [`b5a64da`](https://github.com/browserify/parse-asn1/commit/b5a64da4651941980c91c04e9a4fae814c654aec)
47
+ - Only apps should have lockfiles [`75803fd`](https://github.com/browserify/parse-asn1/commit/75803fda05246c4cf5cd968c5cc87494c03d3cf0)
48
+ - [meta] add `safe-publish-latest` [`aba1931`](https://github.com/browserify/parse-asn1/commit/aba1931df788100a7ffaf6054e5b024caf3d9a23)
49
+ - [Tests] use `aud` [`2a848f6`](https://github.com/browserify/parse-asn1/commit/2a848f6c55d84896a52dcb3bcb54be637e42886d)
50
+ - [meta] add missing `engines.node` [`87e2bd3`](https://github.com/browserify/parse-asn1/commit/87e2bd3f9657ecb4fba7903a0c56305de273c3b6)
51
+ - [Dev Deps] update `tape` [`50baf1c`](https://github.com/browserify/parse-asn1/commit/50baf1c6a4af51a3d4eac1d1508cda69f6f5252a)
52
+ - [Deps] downgrade `asn1.js` to v4 since v5 drops support for node < 4 [`f230870`](https://github.com/browserify/parse-asn1/commit/f23087045497c93bd0a151e29b1e3f738e898cb8)
53
+ - [Deps] pin `hash-base` to ~3.0, due to a breaking change [`f15dc5f`](https://github.com/browserify/parse-asn1/commit/f15dc5f12898fd955ef27d037ba649724f6c5e17)
54
+
55
+ ## [v5.1.6](https://github.com/browserify/parse-asn1/compare/v5.1.5...v5.1.6) - 2020-08-11
56
+
57
+ ### Merged
58
+
59
+ - update asn1 [`#37`](https://github.com/browserify/parse-asn1/pull/37)
60
+ - remove 'create-hash' dependency [`#40`](https://github.com/browserify/parse-asn1/pull/40)
61
+
62
+ ### Commits
63
+
64
+ - fix more deps [`8ebb8a3`](https://github.com/browserify/parse-asn1/commit/8ebb8a3c7aaabd25c90f64cb7304c961ba55cf1d)
65
+
66
+ ## [v5.1.5](https://github.com/browserify/parse-asn1/compare/v5.1.4...v5.1.5) - 2019-09-18
67
+
68
+ ### Merged
69
+
70
+ - Improving published files [`#38`](https://github.com/browserify/parse-asn1/pull/38)
71
+
72
+ ## [v5.1.4](https://github.com/browserify/parse-asn1/compare/v5.1.3...v5.1.4) - 2019-02-14
73
+
74
+ ### Fixed
75
+
76
+ - fixes #35, regex work for pems without linebreaks [`#35`](https://github.com/browserify/parse-asn1/issues/35)
77
+
78
+ ## [v5.1.3](https://github.com/browserify/parse-asn1/compare/v5.1.2...v5.1.3) - 2019-01-17
79
+
80
+ ### Commits
81
+
82
+ - rm const [`635d530`](https://github.com/browserify/parse-asn1/commit/635d530a4e29e07ac89814ef9e2a8de1f7c002ed)
83
+
84
+ ## [v5.1.2](https://github.com/browserify/parse-asn1/compare/v5.1.1...v5.1.2) - 2019-01-17
85
+
86
+ ### Merged
87
+
88
+ - Safe buffer [`#30`](https://github.com/browserify/parse-asn1/pull/30)
89
+ - Add curve as parameter to certificate algorithm [`#28`](https://github.com/browserify/parse-asn1/pull/28)
90
+
91
+ ### Commits
92
+
93
+ - version is optional [`97ca375`](https://github.com/browserify/parse-asn1/commit/97ca3751f2c6b928f26fbc6558823042df7bec5d)
94
+
95
+ ## [v5.1.1](https://github.com/browserify/parse-asn1/compare/v5.1.0...v5.1.1) - 2018-04-11
96
+
97
+ ### Merged
98
+
99
+ - Create LICENSE [`#27`](https://github.com/browserify/parse-asn1/pull/27)
100
+ - make fixproc compliant with common newline conventions [`#22`](https://github.com/browserify/parse-asn1/pull/22)
101
+
102
+ ### Commits
103
+
104
+ - Update README.md [`19789cd`](https://github.com/browserify/parse-asn1/commit/19789cdbd5f529351e2477fae4961d996fbc11a1)
105
+
106
+ ## [v5.1.0](https://github.com/browserify/parse-asn1/compare/v5.0.0...v5.1.0) - 2017-03-13
107
+
108
+ ### Merged
109
+
110
+ - add description [`#20`](https://github.com/browserify/parse-asn1/pull/20)
111
+ - Cert parsing [`#6`](https://github.com/browserify/parse-asn1/pull/6)
112
+
113
+ ### Commits
114
+
115
+ - fix formatting [`febc75d`](https://github.com/browserify/parse-asn1/commit/febc75d6ae3e995ab28d4b1d3e5a040cdd1afb28)
116
+ - merge [`5e306be`](https://github.com/browserify/parse-asn1/commit/5e306be93671655c518569868066f53c9b298b62)
117
+ - fix style [`6131733`](https://github.com/browserify/parse-asn1/commit/6131733f2cea84ca6394e3e6bfe2040daf7eae66)
118
+ - cert parsing [`e571b18`](https://github.com/browserify/parse-asn1/commit/e571b18bf516bcd47c6a5699767ac27398a8e0df)
119
+ - update deps [`eab3500`](https://github.com/browserify/parse-asn1/commit/eab3500f62ddec3491e28c47dcfeb1e54459b747)
120
+ - iter stuff [`00b030c`](https://github.com/browserify/parse-asn1/commit/00b030c2d304ca3a003591abdd10a6e7ef2ce68d)
121
+ - credit [`c94dba3`](https://github.com/browserify/parse-asn1/commit/c94dba391223af0b72687868f88049bb0dfcb276)
122
+
123
+ ## [v5.0.0](https://github.com/browserify/parse-asn1/compare/v4.0.0...v5.0.0) - 2015-10-29
124
+
125
+ ### Merged
126
+
127
+ - bump asn1.js [`#17`](https://github.com/browserify/parse-asn1/pull/17)
128
+
129
+ ## [v4.0.0](https://github.com/browserify/parse-asn1/compare/v3.0.2...v4.0.0) - 2015-10-26
130
+
131
+ ### Merged
132
+
133
+ - bump bn [`#16`](https://github.com/browserify/parse-asn1/pull/16)
134
+
135
+ ## [v3.0.2](https://github.com/browserify/parse-asn1/compare/v3.0.1...v3.0.2) - 2015-09-28
136
+
137
+ ### Merged
138
+
139
+ - pull out evp [`#15`](https://github.com/browserify/parse-asn1/pull/15)
140
+ - evp: simplify overall logic [`#12`](https://github.com/browserify/parse-asn1/pull/12)
141
+
142
+ ### Fixed
143
+
144
+ - adds .travis.yml, resolves #14 [`#14`](https://github.com/browserify/parse-asn1/issues/14)
145
+
146
+ ### Commits
147
+
148
+ - standard [`10d65d0`](https://github.com/browserify/parse-asn1/commit/10d65d07202941a94ef914d883939d318bbbe33d)
149
+ - evp: standard-ish formatting [`be4e43d`](https://github.com/browserify/parse-asn1/commit/be4e43d8ca8a766ef77caf724e7204b3e299d601)
150
+ - evp: improve variable names [`080e62b`](https://github.com/browserify/parse-asn1/commit/080e62bdb1d3dde124ff736a7767cfaa6e4d71db)
151
+ - evp: simplify md_buf logic [`ed059dd`](https://github.com/browserify/parse-asn1/commit/ed059dd60802651722a3e7f7470bbc323b255c99)
152
+ - add badges [`ed3184d`](https://github.com/browserify/parse-asn1/commit/ed3184d7b189e32b3fec3d66de98b0676e10e11b)
153
+ - evp: remove unused ii, avoid inline expressions [`8058c1e`](https://github.com/browserify/parse-asn1/commit/8058c1ec4f39cfea4bb9fdfd81b675e063e28d1d)
154
+ - adds standard and travis targets [`e663708`](https://github.com/browserify/parse-asn1/commit/e66370856e1e20c4b3aa3089734a418b1a752d5e)
155
+ - evp: remove another semicolon [`7e1b6e5`](https://github.com/browserify/parse-asn1/commit/7e1b6e5fdb4781497262aa18939b31b2dbffbadd)
156
+ - evp: remove semicolon [`403330f`](https://github.com/browserify/parse-asn1/commit/403330fb5768c3572b2d3f45a4f003cadac541bf)
157
+ - Rename readme.md to README.md [`cf240ae`](https://github.com/browserify/parse-asn1/commit/cf240ae3283df6afd5aa5bc8e4e7922e8ce0aed2)
158
+
159
+ ## [v3.0.1](https://github.com/browserify/parse-asn1/compare/v3.0.0...v3.0.1) - 2015-05-20
160
+
161
+ ### Merged
162
+
163
+ - Upgrade deps [`#9`](https://github.com/browserify/parse-asn1/pull/9)
164
+ - pbkdf2 [`#5`](https://github.com/browserify/parse-asn1/pull/5)
165
+ - fixProc: simplify wrap [`#10`](https://github.com/browserify/parse-asn1/pull/10)
166
+
167
+ ### Fixed
168
+
169
+ - switch line breaks to \r?\n instead of \n\r? fixes #7 [`#7`](https://github.com/browserify/parse-asn1/issues/7)
170
+
171
+ ### Commits
172
+
173
+ - deal with iterations not being an integer [`c4aee9e`](https://github.com/browserify/parse-asn1/commit/c4aee9e971dac0b7cf9c125e563957cb4c5f2a05)
174
+ - update asn1.js [`92214f6`](https://github.com/browserify/parse-asn1/commit/92214f60a33f761fb97989e29f1d1588968aa621)
175
+ - update repo location [`5e7960a`](https://github.com/browserify/parse-asn1/commit/5e7960a19eab30468dbc6442bf0fce89d1d26e75)
176
+ - Add coverage directory to .npmignore. [`0d11c15`](https://github.com/browserify/parse-asn1/commit/0d11c15d7b2f1dea6243991e5bd98fe6057a80d7)
177
+ - rn .npmignore to .gitignore [`a9abb96`](https://github.com/browserify/parse-asn1/commit/a9abb96008289c241c3372151ac06a8e43a4343e)
178
+
179
+ ## [v3.0.0](https://github.com/browserify/parse-asn1/compare/v2.0.0...v3.0.0) - 2015-01-28
180
+
181
+ ### Commits
182
+
183
+ - add tests, remove dep [`b6ecaa2`](https://github.com/browserify/parse-asn1/commit/b6ecaa2ebca59d3ee9718fcc6515d7215a1bb89a)
184
+ - clean up [`dd84475`](https://github.com/browserify/parse-asn1/commit/dd84475f02741ebc08bed3fc02d36e6d0c1dde7e)
185
+ - make modularized [`7059346`](https://github.com/browserify/parse-asn1/commit/7059346a4b74e3b732151174c26d7eb547acba47)
186
+
187
+ ## [v2.0.0](https://github.com/browserify/parse-asn1/compare/v1.2.1...v2.0.0) - 2015-01-06
188
+
189
+ ### Commits
190
+
191
+ - Update asn1.js and bn.js to 1.0 [`9ab8411`](https://github.com/browserify/parse-asn1/commit/9ab8411d7fb489f9d5cde08efdd9ec041a11c99c)
192
+
193
+ ## [v1.2.1](https://github.com/browserify/parse-asn1/compare/v1.2.0...v1.2.1) - 2015-01-04
194
+
195
+ ### Merged
196
+
197
+ - Update asn1.js [`#1`](https://github.com/browserify/parse-asn1/pull/1)
198
+
199
+ ## [v1.2.0](https://github.com/browserify/parse-asn1/compare/v1.1.0...v1.2.0) - 2014-12-18
200
+
201
+ ### Commits
202
+
203
+ - varient version of passwords [`e1eef0b`](https://github.com/browserify/parse-asn1/commit/e1eef0b1d5534e7f0f08caf4242e0dda274882d5)
204
+
205
+ ## [v1.1.0](https://github.com/browserify/parse-asn1/compare/v1.0.1...v1.1.0) - 2014-12-18
206
+
207
+ ### Commits
208
+
209
+ - updates for dsa [`f1e82d2`](https://github.com/browserify/parse-asn1/commit/f1e82d2b61723ea17b8cd86eef5cbed3b0e4658c)
210
+
211
+ ## v1.0.1 - 2014-12-16
212
+
213
+ ### Commits
214
+
215
+ - first [`6cfeecb`](https://github.com/browserify/parse-asn1/commit/6cfeecb4cd46c8032833e76360386f9c64d88c19)
216
+ - handle strings [`df96666`](https://github.com/browserify/parse-asn1/commit/df9666656c6edf341a2e99549b197334c5fa2fc9)
package/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright (c) 2017, crypto-browserify contributors
2
+
3
+ Permission to use, copy, modify, and/or distribute this software for any
4
+ purpose with or without fee is hereby granted, provided that the above
5
+ copyright notice and this permission notice appear in all copies.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # @unabandoned/parse-asn1
2
+
3
+ > A maintained fork of [crypto-browserify/parse-asn1](https://github.com/crypto-browserify/parse-asn1),
4
+ > adopted because it was the last path by which abandoned packages re-entered the
5
+ > `@unabandoned` crypto trees. Published as
6
+ > [`@unabandoned/parse-asn1`](https://www.npmjs.com/package/@unabandoned/parse-asn1);
7
+ > the API is unchanged from upstream.
8
+
9
+
10
+ [![TRAVIS](https://secure.travis-ci.org/crypto-browserify/parse-asn1.png)](http://travis-ci.org/crypto-browserify/parse-asn1)
11
+ [![NPM](http://img.shields.io/npm/v/parse-asn1.svg)](https://www.npmjs.org/package/parse-asn1)
12
+
13
+ [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
14
+
15
+ utility library for parsing asn1 files for use with browserify-sign.
package/aesid.json ADDED
@@ -0,0 +1,13 @@
1
+ {"2.16.840.1.101.3.4.1.1": "aes-128-ecb",
2
+ "2.16.840.1.101.3.4.1.2": "aes-128-cbc",
3
+ "2.16.840.1.101.3.4.1.3": "aes-128-ofb",
4
+ "2.16.840.1.101.3.4.1.4": "aes-128-cfb",
5
+ "2.16.840.1.101.3.4.1.21": "aes-192-ecb",
6
+ "2.16.840.1.101.3.4.1.22": "aes-192-cbc",
7
+ "2.16.840.1.101.3.4.1.23": "aes-192-ofb",
8
+ "2.16.840.1.101.3.4.1.24": "aes-192-cfb",
9
+ "2.16.840.1.101.3.4.1.41": "aes-256-ecb",
10
+ "2.16.840.1.101.3.4.1.42": "aes-256-cbc",
11
+ "2.16.840.1.101.3.4.1.43": "aes-256-ofb",
12
+ "2.16.840.1.101.3.4.1.44": "aes-256-cfb"
13
+ }
package/asn1.js ADDED
@@ -0,0 +1,123 @@
1
+ // from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js
2
+ // Fedor, you are amazing.
3
+
4
+ 'use strict';
5
+
6
+ var asn1 = require('@unabandoned/asn1.js');
7
+
8
+ exports.certificate = require('./certificate');
9
+
10
+ var RSAPrivateKey = asn1.define('RSAPrivateKey', function () {
11
+ this.seq().obj(
12
+ this.key('version')['int'](),
13
+ this.key('modulus')['int'](),
14
+ this.key('publicExponent')['int'](),
15
+ this.key('privateExponent')['int'](),
16
+ this.key('prime1')['int'](),
17
+ this.key('prime2')['int'](),
18
+ this.key('exponent1')['int'](),
19
+ this.key('exponent2')['int'](),
20
+ this.key('coefficient')['int']()
21
+ );
22
+ });
23
+ exports.RSAPrivateKey = RSAPrivateKey;
24
+
25
+ var RSAPublicKey = asn1.define('RSAPublicKey', function () {
26
+ this.seq().obj(
27
+ this.key('modulus')['int'](),
28
+ this.key('publicExponent')['int']()
29
+ );
30
+ });
31
+ exports.RSAPublicKey = RSAPublicKey;
32
+
33
+ var AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () {
34
+ this.seq().obj(
35
+ this.key('algorithm').objid(),
36
+ this.key('none').null_().optional(),
37
+ this.key('curve').objid().optional(),
38
+ this.key('params').seq().obj(
39
+ this.key('p')['int'](),
40
+ this.key('q')['int'](),
41
+ this.key('g')['int']()
42
+ ).optional()
43
+ );
44
+ });
45
+
46
+ var PublicKey = asn1.define('SubjectPublicKeyInfo', function () {
47
+ this.seq().obj(
48
+ this.key('algorithm').use(AlgorithmIdentifier),
49
+ this.key('subjectPublicKey').bitstr()
50
+ );
51
+ });
52
+ exports.PublicKey = PublicKey;
53
+
54
+ var PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () {
55
+ this.seq().obj(
56
+ this.key('version')['int'](),
57
+ this.key('algorithm').use(AlgorithmIdentifier),
58
+ this.key('subjectPrivateKey').octstr()
59
+ );
60
+ });
61
+ exports.PrivateKey = PrivateKeyInfo;
62
+ var EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () {
63
+ this.seq().obj(
64
+ this.key('algorithm').seq().obj(
65
+ this.key('id').objid(),
66
+ this.key('decrypt').seq().obj(
67
+ this.key('kde').seq().obj(
68
+ this.key('id').objid(),
69
+ this.key('kdeparams').seq().obj(
70
+ this.key('salt').octstr(),
71
+ this.key('iters')['int']()
72
+ )
73
+ ),
74
+ this.key('cipher').seq().obj(
75
+ this.key('algo').objid(),
76
+ this.key('iv').octstr()
77
+ )
78
+ )
79
+ ),
80
+ this.key('subjectPrivateKey').octstr()
81
+ );
82
+ });
83
+
84
+ exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo;
85
+
86
+ var DSAPrivateKey = asn1.define('DSAPrivateKey', function () {
87
+ this.seq().obj(
88
+ this.key('version')['int'](),
89
+ this.key('p')['int'](),
90
+ this.key('q')['int'](),
91
+ this.key('g')['int'](),
92
+ this.key('pub_key')['int'](),
93
+ this.key('priv_key')['int']()
94
+ );
95
+ });
96
+ exports.DSAPrivateKey = DSAPrivateKey;
97
+
98
+ exports.DSAparam = asn1.define('DSAparam', function () {
99
+ this['int']();
100
+ });
101
+
102
+ var ECParameters = asn1.define('ECParameters', function () {
103
+ this.choice({
104
+ namedCurve: this.objid()
105
+ });
106
+ });
107
+
108
+ var ECPrivateKey = asn1.define('ECPrivateKey', function () {
109
+ this.seq().obj(
110
+ this.key('version')['int'](),
111
+ this.key('privateKey').octstr(),
112
+ this.key('parameters').optional().explicit(0).use(ECParameters),
113
+ this.key('publicKey').optional().explicit(1).bitstr()
114
+ );
115
+ });
116
+ exports.ECPrivateKey = ECPrivateKey;
117
+
118
+ exports.signature = asn1.define('signature', function () {
119
+ this.seq().obj(
120
+ this.key('r')['int'](),
121
+ this.key('s')['int']()
122
+ );
123
+ });
package/certificate.js ADDED
@@ -0,0 +1,89 @@
1
+ // from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js
2
+ // thanks to @Rantanen
3
+
4
+ 'use strict';
5
+
6
+ var asn = require('@unabandoned/asn1.js');
7
+
8
+ var Time = asn.define('Time', function () {
9
+ this.choice({
10
+ utcTime: this.utctime(),
11
+ generalTime: this.gentime()
12
+ });
13
+ });
14
+
15
+ var AttributeTypeValue = asn.define('AttributeTypeValue', function () {
16
+ this.seq().obj(
17
+ this.key('type').objid(),
18
+ this.key('value').any()
19
+ );
20
+ });
21
+
22
+ var AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () {
23
+ this.seq().obj(
24
+ this.key('algorithm').objid(),
25
+ this.key('parameters').optional(),
26
+ this.key('curve').objid().optional()
27
+ );
28
+ });
29
+
30
+ var SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () {
31
+ this.seq().obj(
32
+ this.key('algorithm').use(AlgorithmIdentifier),
33
+ this.key('subjectPublicKey').bitstr()
34
+ );
35
+ });
36
+
37
+ var RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () {
38
+ this.setof(AttributeTypeValue);
39
+ });
40
+
41
+ var RDNSequence = asn.define('RDNSequence', function () {
42
+ this.seqof(RelativeDistinguishedName);
43
+ });
44
+
45
+ var Name = asn.define('Name', function () {
46
+ this.choice({
47
+ rdnSequence: this.use(RDNSequence)
48
+ });
49
+ });
50
+
51
+ var Validity = asn.define('Validity', function () {
52
+ this.seq().obj(
53
+ this.key('notBefore').use(Time),
54
+ this.key('notAfter').use(Time)
55
+ );
56
+ });
57
+
58
+ var Extension = asn.define('Extension', function () {
59
+ this.seq().obj(
60
+ this.key('extnID').objid(),
61
+ this.key('critical').bool().def(false),
62
+ this.key('extnValue').octstr()
63
+ );
64
+ });
65
+
66
+ var TBSCertificate = asn.define('TBSCertificate', function () {
67
+ this.seq().obj(
68
+ this.key('version').explicit(0)['int']().optional(),
69
+ this.key('serialNumber')['int'](),
70
+ this.key('signature').use(AlgorithmIdentifier),
71
+ this.key('issuer').use(Name),
72
+ this.key('validity').use(Validity),
73
+ this.key('subject').use(Name),
74
+ this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo),
75
+ this.key('issuerUniqueID').implicit(1).bitstr().optional(),
76
+ this.key('subjectUniqueID').implicit(2).bitstr().optional(),
77
+ this.key('extensions').explicit(3).seqof(Extension).optional()
78
+ );
79
+ });
80
+
81
+ var X509Certificate = asn.define('X509Certificate', function () {
82
+ this.seq().obj(
83
+ this.key('tbsCertificate').use(TBSCertificate),
84
+ this.key('signatureAlgorithm').use(AlgorithmIdentifier),
85
+ this.key('signatureValue').bitstr()
86
+ );
87
+ });
88
+
89
+ module.exports = X509Certificate;
@@ -0,0 +1 @@
1
+ module.exports = { extends: ["@commitlint/config-conventional"] };