pam_pkcs11  0.6.8
Defines | Functions
base64.h File Reference

Go to the source code of this file.

Defines

#define BASE64_EXTERN   extern

Functions

BASE64_EXTERN int base64_encode (const unsigned char *in, size_t len, unsigned char *out, size_t *outlen)
 Encode byte array into a base64 string.
BASE64_EXTERN int base64_decode (const char *in, unsigned char *out, size_t outlen)
 Decode a base64 string into a byte array.

Define Documentation

#define BASE64_EXTERN   extern

Definition at line 24 of file base64.h.


Function Documentation

BASE64_EXTERN int base64_decode ( const char *  in,
unsigned char *  out,
size_t  outlen 
)

Decode a base64 string into a byte array.

Parameters:
inInput string data
outPointer to pre-allocated buffer space
outlenSize of buffer
Returns:
Length of converted byte array, or -1 on error
BASE64_EXTERN int base64_encode ( const unsigned char *  in,
size_t  len,
unsigned char *  out,
size_t *  outlen 
)

Encode byte array into a base64 string.

Parameters:
inPointer to byte array
lenlenght of input data
outPointer to preallocated buffer space
outlenSize of buffer
Returns:
0 on sucess, -1 on error