pam_pkcs11 0.6.12
base64.h File Reference

Go to the source code of this file.

Macros

#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.
 

Macro Definition Documentation

◆ BASE64_EXTERN

#define BASE64_EXTERN   extern

Definition at line 24 of file base64.h.

Referenced by base64_decode(), and base64_encode().

Function Documentation

◆ base64_decode()

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

References BASE64_EXTERN.

◆ base64_encode()

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

References BASE64_EXTERN.