KEYRING-CERTTOSTR(2)KEYRING-CERTTOSTR(2)NAME
keyring: certtostr, pktostr, sktostr, strtocert, strtopk, strtosk -
encryption key conversion functions
SYNOPSIS
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;
DESCRIPTION
Certificates, public keys, and private keys are passed over networks
and between applications using a Unicode representation. This collec‐
tion of functions provide a means to convert adts supplied by the sys‐
tem to and from their portable textual representation. These routines
are typically used as part of an I/O package for implementing security.
Strtocert takes a string argument containing a user name, a hash algo‐
rithm, a certifying authority and an expiration time. Fields are sepa‐
rated by a newline. The return value is a Certificate. If the string
is of improper format, the result is nil.
Certtostr performs the inverse operation: takes the Certificate c and
produces a text string suitable for communication over a network.
Strtopk and strtosk take as their arguments a string s representing the
public and private keys respectively. S must contain an algorithm
name, a user name and the key. Fields are separated by a newline. Str‐
topk returns a reference to the resulting PK; strtosk returns a refer‐
ence to the resulting SK. If the format of s is invalid, the result is
nil.
Pktostr and sktostr perform the inverse operations: they take a public
key (secret key) and produce a printable representation as a string.
SOURCE
/libinterp/keyring.c
KEYRING-CERTTOSTR(2)