pam_pkcs11 0.6.8

- Main Page
- Data Structures
- Files
- Directories

- File List
- Globals

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:

  in | Input string data
  out | Pointer to pre-allocated buffer space
  outlen | Size 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:

  in | Pointer to byte array
  len | lenght of input data
  out | Pointer to preallocated buffer space
  outlen | Size of buffer

Returns:
  0 on sucess, -1 on error