1 | sbool signWithComputerIDAndDate_verbose; |
2 | sbool signWithComputerIDAndDate_verify; |
3 | |
4 | // appends a new line with computer id and signature |
5 | static S signWithComputerIDAndDate(S s, O... _) { |
6 | bool verbose = optPar verbose(_, signWithComputerIDAndDate_verbose); |
7 | S computerID = getComputerID(); |
8 | s = rtrim(s) + "\n\n" + "-" + computerID() + ", " + localDateWithMilliseconds() + " (" + localTimeZone().getDisplayName(false, TimeZone.SHORT) + ")"; |
9 | s = fromLines(toLines(s)); |
10 | if (verbose) |
11 | print("Signing text: " + shorten(quote(s))); |
12 | S signed = s + "sig: " + getMySignatureForText(s); |
13 | signed = fromLines(toLines(signed)); |
14 | if (optPar verify(_, signWithComputerIDAndDate_verify)) |
15 | assertEqualsOptionalVerbose(verbose, "My own signature", computerID(), getAuthorOfSignedText(signed)); |
16 | ret signed; |
17 | } |
Began life as a copy of #1001566
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1017114 |
Snippet name: | signWithComputerIDAndDate |
Eternal ID of this version: | #1017114/12 |
Text MD5: | b03dab42b4c14e38d350a17e92b189cf |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-06-10 14:36:38 |
Source code size: | 825 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 480 / 543 |
Version history: | 11 change(s) |
Referenced in: | [show references] |