XML Security Library Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# buffered.h

## Name

buffered.h -- The buffered transform.

## Synopsis

    struct      xmlSecBufferedTransform;
    typedef     xmlSecBufferedTransformId;
    int         (*xmlSecBufferedProcessMethod)  (xmlSecBufferedTransformPtr transform,
                                                 xmlBufferPtr buffer);
    int         xmlSecBufferedTransformRead     (xmlSecBinTransformPtr transform,
                                                 unsigned char *buf,
                                                 size_t size);
    int         xmlSecBufferedTransformWrite    (xmlSecBinTransformPtr transform,
                                                 unsigned char *buf,
                                                 size_t size);
    int         xmlSecBufferedTransformFlush    (xmlSecBinTransformPtr transform);
    void        xmlSecBufferedDestroy           (xmlSecBufferedTransformPtr buffered);
    int         xmlSecBufferedProcess           (xmlSecBinTransformPtr transform,
                                                 xmlBufferPtr buffer);

## Description

## Details

### struct xmlSecBufferedTransform

    struct xmlSecBufferedTransform {
        /* same as for xmlSecTransform but id type changed */
        xmlSecBufferedTransformId		id;
        xmlSecTransformStatus		status;
        int					dontDestroy;
        void				*data;

        /* xmlSecBinTransform specific */
        int					encode;
        xmlSecBinTransformPtr		next;
        xmlSecBinTransformPtr		prev;
        void				*binData;

        /* xmlSecBufferedTransform specific */
        xmlBufferPtr			buffer;
    };

The buffered transform.

xmlSecBufferedTransformId `id` | the transform id (pointer to xmlSecBinTransformId).
xmlSecTransformStatus `status` | the transform status (ok/fail/unknown).
int `dontDestroy` | the don't automatically destroy flag.
void *`data` | the pointer to transform specific data.
int `encode` | encode/decode (encrypt/decrypt) flag.
xmlSecBinTransformPtr `next` | next binary transform in the chain.
xmlSecBinTransformPtr `prev` | previous binary transform in the chain.
void *`binData` | the pointer to binary transform speific data.
xmlBufferPtr `buffer` | the internal buffer.

### xmlSecBufferedTransformId

    typedef const struct _xmlSecBufferedTransformIdStruct	*xmlSecBufferedTransformId;

The buffered transform id.

### xmlSecBufferedProcessMethod ()

    int         (*xmlSecBufferedProcessMethod)  (xmlSecBufferedTransformPtr transform,
                                                 xmlBufferPtr buffer);

Processes the data in the buffer.

`transform` : | the pointer to buffered transform.
`buffer` : | the pointer to input/output buffer.
Returns : | 0 in success or a negative value otherwise.

### xmlSecBufferedTransformRead ()

    int         xmlSecBufferedTransformRead     (xmlSecBinTransformPtr transform,
                                                 unsigned char *buf,
                                                 size_t size);

Reads the all data from previous transform and returns to the caller.

`transform` : | the pointer to a buffered transform.
`buf` : | the output buffer.
`size` : | the output buffer size.
Returns : | the number of bytes in the buffer or negative value if an error occurs.

### xmlSecBufferedTransformWrite ()

    int         xmlSecBufferedTransformWrite    (xmlSecBinTransformPtr transform,
                                                 unsigned char *buf,
                                                 size_t size);

Adds the data to the internal buffer.

`transform` : | the poiter to a buffered transform.
`buf` : | the input data buffer.
`size` : | the input data size.
Returns : | 0 if success or a negative value otherwise.

### xmlSecBufferedTransformFlush ()

    int         xmlSecBufferedTransformFlush    (xmlSecBinTransformPtr transform);

Writes internal data to previous transform.

`transform` : | the pointer to a buffered transform.
Returns : | 0 if success or negative value otherwise.

### xmlSecBufferedDestroy ()

    void        xmlSecBufferedDestroy           (xmlSecBufferedTransformPtr buffered);

Destroys the buffered transform.

`buffered` : | the pointer to a buffered transform.

### xmlSecBufferedProcess ()

    int         xmlSecBufferedProcess           (xmlSecBinTransformPtr transform,
                                                 xmlBufferPtr buffer);

Executes buffered transform.

`transform` : | the pointer to a buffered transform.
`buffer` : | the buffered transform result,
Returns : | number of bytes processed or a negative value if an error occurs.

<<< Previous Page | Home | Up | Next Page >>>
bn.h | ciphers.h