View/Edit #111:dearmour

Switch to edit mode.

Name(s): dearmour
1:  "=> { title (PGP PUBLIC KEY BLOCK), {{\"header\", \"value\"},...}, \"data\", checksum, verified?}"
2:  {t} = args
3:  line = 1
4:  while (index(t[line], "-----") != 1 && rindex(t[line], "-----") != length(t[line]) - 5 && length(t[line]) != 5)
5:    line = line + 1
6:  endwhile
7:  if (t[line][6..10] != "BEGIN")
8:    raise(E_INVARG, "No BEGIN line")
9:  endif
10: title = t[line][12..$ - 5]
11: line = line + 1
12: headers = {}
13: while (t[line] != "")
14:   if (!(colon = index(t[line], ":")))
15:     raise(E_INVARG, tostr("Invalid header line: \"", t[line], "\""))
16:   endif
17:   headers = {@headers, {t[line][1..colon - 1], t[line][colon + 2..$]}}
18:   line = line + 1
19: endwhile
20: line = line + 1
21: lastline = line
22: while (t[lastline] != tostr("-----END ", title, "-----"))
23:   lastline = lastline + 1
24: endwhile
25: data = tostr(@t[line..lastline - 2])
26: data = $string_utils:unbase64(data)
27: checksum = t[lastline - 1]
28: checksum = decode_binary($string_utils:unbase64(checksum[2..$]), 1)
29: checksum = checksum[1] * 256 * 256 + checksum[2] * 256 + checksum[3]
30: return {title, headers, data, checksum}
31: "Last modified by manta (#7165) on Sun Feb 18 21:42:26 2001 MST."
32: "This verb previously owned by manta (#7165), and chowned to $slacker upon dewizarding (Sat Aug 17 14:50:05 2002 MDT)."
33: "Last modified by Dax (#789) on Sat Aug 17 14:50:05 2002 MDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

[home | help | who | search | setup | code]