Crypt-SecurID
view release on metacpan or search on metacpan
securid.cpp view on Meta::CPAN
// export key to a secret token file
int SecurID::exportToken(const char *f, const char *sernum) {
struct stat statbuf;
FILE *fo;
long i, serial;
SID_OCTET data[5];
char outs[80], *s;
unsigned int l;
// stat and bail if file exists
if (!stat(f, &statbuf)) {
sprintf(errmsg, "Cannot export to existing file: '%s'.", f);
return 0;
}
// open file, creating if necessary
fo = fopen(f, "w+");
if (fo == NULL) {
sprintf(errmsg, "Cannot create token secret file: '%s'.", f);
return 0;
}
( run in 0.776 second using v1.01-cache-2.11-cpan-49f99fa48dc )