1 | static bool locallyVerifyUserStatement(S signed) {
|
2 | try {
|
3 | L<S> lines = toLines(signed); |
4 | S authorLine = lines.get(lines.size()-2); |
5 | S sigLine = lines.get(lines.size()-1); |
6 | S text = fromLines(lines.subList(0, lines.size()-1)); |
7 | S author = dropPrefixMandatory("-", authorLine);
|
8 | S cid = trim(dropSuffix("[user]", author));
|
9 | if (!isComputerID(cid)) fail("Not a computer ID: " + cid);
|
10 | byte[] publicKey = PKI.userPublicKey(); |
11 | S sig = dropPrefixMandatory("sig: ", sigLine);
|
12 | ret PKI.verifySignature(publicKey, PKI.signatureFromString(sig), toUtf8(text)); |
13 | } catch (RuntimeException e) {
|
14 | ret false; |
15 | } |
16 | } |
Began life as a copy of #1001567
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1004861 |
| Snippet name: | locallyVerifyUserStatement |
| Eternal ID of this version: | #1004861/1 |
| Text MD5: | 77dba25c1bff4808af0bb91b27267508 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2016-09-06 19:20:53 |
| Source code size: | 653 bytes / 16 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 681 / 720 |
| Referenced in: | [show references] |