Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 41a0e7c

Browse files
committed
feat: update pgp examples to use npm commands
1 parent d477c0b commit 41a0e7c

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

content/packages-and-modules/securing-your-code/verifying-the-pgp-signature-for-a-package-from-the-npm-public-registry.mdx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ To ensure the integrity of a package version you download from the npm public re
2828
1. On the command line, fetch the signature for the package version you want and save it in a file:
2929

3030
```
31-
$ http GET https://registry.npmjs.org/light-cycle | json "versions['1.4.3'].dist.npm-signature" > sig-to-check
31+
npm view light-cycle@1.4.3 --json | npm exec json ".dist.npm-signature" > sig-to-check
3232
```
3333

3434
2. Get the integrity field for that version (example below includes response):
3535

3636
```
37-
$ http GET https://registry.npmjs.org/light-cycle | json "versions['1.4.3'].dist.integrity"
37+
npm view light-cycle@1.4.3 --json | npm exec json ".dist.integrity"
3838
```
3939

4040
Example response:
@@ -46,19 +46,18 @@ To ensure the integrity of a package version you download from the npm public re
4646
3. Construct the string that ties the unique package name and version to the integrity string (example below includes response):
4747

4848
```
49-
$ keybase pgp verify --signed-by npmregistry -d sig-to-check -m '[email protected]:sha512-sFcuivsDZ99fY0TbvuRC6CDXB8r/ylafjJAMnbSF0y4EMM1/1DtQo40G2WKz1rBbyiz4SLAc3Wa6yZyC4XSGOQ=='
49+
keybase pgp verify --signed-by npmregistry -d sig-to-check -m '[email protected]:sha512-sFcuivsDZ99fY0TbvuRC6CDXB8r/ylafjJAMnbSF0y4EMM1/1DtQo40G2WKz1rBbyiz4SLAc3Wa6yZyC4XSGOQ=='
5050
```
5151

5252
Example response:
5353

5454
```
5555
▶ INFO Identifying npmregistry
56-
✔ <tracked> public key fingerprint: 0963 1802 8A2B 58C8 4929 D8E1 3D4D 5B12 0276 566A
57-
You last followed npmregistry on 2018-04-10 21:21:57 PDT
58-
✔ <tracked> admin of DNS zone npmjs.com: found TXT entry keybase-site-verification=iK3pjpRBkv-CIJ4PHtWL4TTcFXMpPiwPynatKl3oWO4
59-
✔ <tracked> "npmjs" on twitter: https://twitter.com/npmjs/status/981288548845240320 [cached 2018-04-12 13:18:31 PDT; but got a retryable error (API network error: Get https://twitter.com/npmjs/status/981288548845240320: net/http: request canceled (Client.Timeout exceeded while awaiting headers) (code=170)) this time around]
60-
✔ <tracked> admin of DNS zone npmjs.org: found TXT entry keybase-site-verification=Ls8jN55i6KesjiX91Ck79bUZ17eA-iohmw2jJFM16xc
61-
Signature verified. Signed by npmregistry 7 minutes ago (2018-04-13 15:00:37 -0700 PDT).
56+
✔ public key fingerprint: 0963 1802 8A2B 58C8 4929 D8E1 3D4D 5B12 0276 566A
57+
✔ admin of DNS zone npmjs.org: found TXT entry keybase-site-verification=Ls8jN55i6KesjiX91Ck79bUZ17eA-iohmw2jJFM16xc
58+
✔ admin of DNS zone npmjs.com: found TXT entry keybase-site-verification=iK3pjpRBkv-CIJ4PHtWL4TTcFXMpPiwPynatKl3oWO4
59+
✔ "npmjs" on twitter: https://twitter.com/npmjs/status/981288548845240320
60+
Signature verified. Signed by npmregistry 3 years ago (2018-04-13 15:00:37 -0700 MST).
6261
PGP Fingerprint: 096318028a2b58c84929d8e13d4d5b120276566a.
6362
```
6463

0 commit comments

Comments
 (0)