[Top] [Prev] [Next] [Bottom]


[Contents] [Index]

certtostr, pktostr, sktostr, strtocert, strtopk, strtosk -encryption key conversion functions

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 collection of functions provide a means to convert adts supplied by the system to and from their portable textual representation. These routines are typically used as part of an I/O package for implementing security.

strtocert (s)

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 (c)

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 (s) and strtosk (pk)

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.

pktostr (pk) and sktostr (sk)

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.



[Top] [Prev] [Next] [Bottom]

infernosupport@lucent.com
Copyright © 1997, Lucent Technologies, Inc.. All rights reserved.