Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
README | D | 03-May-2024 | 1.1 KiB | 33 | 18 | |
payload.json | D | 03-May-2024 | 1.1 KiB | 42 | 41 | |
private_key.pem | D | 03-May-2024 | 1.6 KiB | 28 | 27 | |
public_key.pem | D | 03-May-2024 | 451 | 10 | 9 | |
verified_contents.json | D | 03-May-2024 | 2.1 KiB | 21 | 20 |
README
1 2The public/private key pairs were generated with the following commands: 3 4openssl genrsa -out private_key.pem 2048 5openssl rsa -in private_key.pem -pubout -out public_key.pem 6 7 8The payload.json file contains randomly generated base64url encoded sha256 9hashes for a set of file paths. 10 11 12The signature was generated by: 13 141) Take the contents of payload.json and base64url encode them: 15cat payload.json | tr -d \\n | base64 -w0 | tr / _ | tr + \- | tr -d '=' > payload_encoded.txt 16 172) Put the contents of payload_encoded.txt into the "payload" field of 18verified_contents.json. 19 203) Copy the contents of the "protected" field (the one with {"kid": 21"webstore"}) from verified_contents.json into protected.txt. 22 234) Concatenate the "protected" and "payload" fields with a '.' separator. 24 25echo -n '.' | cat protected.txt - payload_encoded.txt > signature_input.txt 26 275) Sign it 28 29tr -d \\n < signature_input.txt | openssl dgst -sha256 -sign private_key.pem -binary | base64 -w0 | tr / _ | tr + \- | tr -d '=' > signature.txt 30 316) Put the contents of signature.txt into the "signature" field in 32verified_contents.json. 33