include "keyring.m" keyring:= load Keyring Keyring->PATH; strtocert: fn(s: string) : ref Certificate; certtostr: fn(c: ref Certificate): string; strtopk: fn(s: string) : ref PK; pktostr: fn(pk: ref PK) : string; strtosk: fn(s: string) : ref SK; sktostr: fn(sk: ref SK) : string;
strtocert: fn(s: string) : ref Certificate;
## returns nil on error.The strtocert function takes a string argument containing a user name, hash algorithm, a certifying authority and an expiration time. Fields are separated by a newline. The return value is a ref Certificate. If the string is of improper format, the result is nil.
certtostr: fn(c: ref Certificate): string;The certtostr function performs the inverse operation of the strtocert function. It takes as an argument a ref Certificate and produces a text string suitable for communication over a network.
strtopk: fn(s: string) : ref PK; strtosk: fn(s: string) : ref SK;
## returns nil on error.The strtopk and strtosk functions take as their arguments a string representing the public and private key adts respectively. The string argument must contain an algorithm name, a user name and the key. Fields are separated by a newline. The result for strtopk is a ref PK and for strtosk a ref SK. If the string is of improper format the result is nil.
sktostr: fn(sk: ref SK) : string; pktostr: fn(pk: ref PK) : string;
## returns nil on error.The pktostr and sktostr functions perform the inverse operations of the strtopk and strtosk functions, respectively.
They take a ref PK or ref SK and produce a text string.