Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: extensions/test/data/content_verifier/README

Issue 273093002: Minor fix to README and test data file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | extensions/test/data/content_verifier/verified_contents.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 The public/private key pairs were generated with the following commands: 2 The public/private key pairs were generated with the following commands:
3 3
4 openssl genrsa -out private_key.pem 2048 4 openssl genrsa -out private_key.pem 2048
5 openssl rsa -in private_key.pem -pubout -out public_key.pem 5 openssl rsa -in private_key.pem -pubout -out public_key.pem
6 6
7 7
8 The signature was generated by: 8 The signature was generated by:
9 9
10 1) Take the contents of payload.json and base64url encode them: 10 1) Take the contents of payload.json and base64url encode them:
11 cat payload.json | tr -d \\n | base64 -w0 | tr _ / | tr \- + | tr -d '=' > paylo ad_encoded.txt 11 cat payload.json | tr -d \\n | base64 -w0 | tr / _ | tr + \- | tr -d '=' > paylo ad_encoded.txt
12 12
13 2) Put the contents of payload_encoded.txt into the "payload" field of 13 2) Put the contents of payload_encoded.txt into the "payload" field of
14 verified_contents.json. 14 verified_contents.json.
15 15
16 3) Copy the contents of the "protected" field from verified_contents.json into 16 3) Copy the contents of the "protected" field from verified_contents.json into
17 protected.txt. 17 protected.txt.
18 18
19 4) Concatenate the "protected" and "payload" fields with a '.' separator. 19 4) Concatenate the "protected" and "payload" fields with a '.' separator.
20 20
21 echo -n '.' | cat protected.txt - payload_encoded.txt > signature_input.txt 21 echo -n '.' | cat protected.txt - payload_encoded.txt > signature_input.txt
22 22
23 5) Sign it 23 5) Sign it
24 24
25 tr -d \\n < signature_input.txt | openssl dgst -sha256 -sign private_key.pem -bi nary | base64 -w0 | tr _ / | tr \- + | tr -d '=' > signature.txt 25 tr -d \\n < signature_input.txt | openssl dgst -sha256 -sign private_key.pem -bi nary | base64 -w0 | tr / _ | tr + \- | tr -d '=' > signature.txt
26 26
27 6) Put the contents of signature.txt into the "signature" field in 27 6) Put the contents of signature.txt into the "signature" field in
28 verified_contents.json. 28 verified_contents.json.
OLDNEW
« no previous file with comments | « no previous file | extensions/test/data/content_verifier/verified_contents.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698