EVP_EncodeInit() -- SSLeay 0.9.0b -- January 1999

NAME

EVP_EncodeInit, EVP_EncodeUpdate, EVP_EncodeFinal, EVP_EncodeBlock,
EVP_DecodeInit, EVP_DecodeUpdate, EVP_DecodeFinal,
EVP_DecodeBlock -- EVP base64 encoding/decoding

SYNOPSIS

#include "envelope.h"

void EVP_EncodeInit(ctx)
EVP_ENCODE_CTX *ctx;

void EVP_EncodeUpdate(ctx,out,outl,in,inl)
EVP_ENCODE_CTX *ctx;
unsigned char *out, *in;
int *outl, inl;

void EVP_EncodeFinal(ctx,out,outl)
EVP_ENCODE_CTX *ctx;
unsigned char *out;
int *outl;

int EVP_EncodeBlock(t,f,n)
unsigned char *t, *f;
int n;

void EVP_DecodeInit(ctx)
EVP_ENCODE_CTX *ctx;

int EVP_DecodeUpdate(ctx,out,outl,in,inl)
EVP_ENCODE_CTX *ctx;
unsigned char *out, *in;
int *outl, inl;

int EVP_DecodeFinal(ctx,out,outl)
EVP_ENCODE_CTX *ctx;
unsigned char *out;
int *outl;

int EVP_DecodeBlock(t,f,n)
unsigned char *t, *f;
int n;

DESCRIPTION

All of these routines are used to deal with base 64 encoding for pem objects.

EVP_EncodeInit() initializes an encoding context structure ctx which is used during all encoding operations.

EVP_EncodeUpdate copies inl bytes of the input string in into a previously-initialized ctx; if any data was already stored in the ctx, it is base64-encoded first and the results written to out. The number of bytes written to out is placed in outl.

Note that the first time this function is called, the input string is copied into the ctx but since there is no input data already in ctx, no data is base64-encoded. In effect, output is always one function call behind the input.

EVP_EncodeFinal() base64-encodes the data in a previously initialized and filledctx and writes the results to out. The number of bytes written is placed in outl.

EVP_EncodeBlock() takes dlen bytes of the data in the string f and base64-encodes them. The results are written into the string t. It returns the number of bytes written.

This routine is called by both EVP_EncodeUpdate and EVP_EncodeFinal.

EVP_DecodeInit initializes a decoding context structure ctx which is used during all decoding operations.

EVP_DecodeUpdate copies inl bytes of the input string in into a previously-initialized ctx; if any data was already stored in the ctx, it is base64-decoded first and the results written to out. The number of bytes written to out is placed in outl.

It returns:

EVP_DecodeFinal() base64-decodes n bytes of the data in a previously initialized and filledctx and writes the results to out. The number of bytes written is placed in outl.

It returns the number of bytes written, or -1 on error.

EVP_DecodeBlock() takes n bytes of the data in the string f and base64-decodes them. The results are written into the string t. It returns the number of bytes written.