XSocket API  2.0
XIA Socket Library
Functions
Xkeys.c File Reference

XmakeNewSID(), XremoveSID(), XcreateFID(), XremoveFID() – create/delete cryptographic SIDs & FIDs. More...

#include "Xsocket.h"

Functions

int XremoveSID (const char *sid)
 remove keys associated with given SID More...
 
int XmakeNewSID (char *randomSID, int randomSIDlen)
 make a new SID backed by a crypto key-pair More...
 
int XcreateFID (char *fid, int len)
 create and register an FID More...
 
int XremoveFID (const char *fid)
 delete and un-register an FID More...
 
int XexistsSID (const char *sid)
 check if keys corresponding to an SID exist locally More...
 

Detailed Description

Todo:
write docs

Function Documentation

int XcreateFID ( char *  fid,
int  len 
)

Returns a text string containing a FID made from the a 160 bit cryptographic hash from a newly created public/private keypair in the form of FID:nnnnn.....

The new FID is also registered in the local routing table so that destination DAGs using the FID will be handled locally.

Parameters
fida buffer to receive the newly created FID.
lenthe length of fid. If less then 45 characters an error will be returned.
Returns
0 on success
-1 on error with errno set
int XexistsSID ( const char *  sid)
Parameters
sidSession Identifier whose keys we are looking for
Returns
1 if keys corresponding to SID are available.
0 if the keys for the given SID are not found.
int XmakeNewSID ( char *  randomSID,
int  randomSIDlen 
)

Create a new session identifier that an application can use to uniquely identify itself in XIA.

Parameters
randomSIDa buffer to return the newly generated SID
randomSIDlenlength of randomSID buffer
Returns
0 on success
-1 on failure
int XremoveFID ( const char *  fid)

Remove the FID from the local routing table and delete the associated keypair.

Parameters
fidthe FID to remove
Returns
0 on success
-1 on error
int XremoveSID ( const char *  sid)

An SID is a hash of the public key preceded by the string "SID:". We remove the key files associated with the given SID.

Parameters
sidstring representing the SID
Returns
0 on successful deletion of key-pair files associated with sid
-1 on failure