Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

PrivDES Class Reference

#include <auth_priv.h>

Inheritance diagram for PrivDES:

[legend]
Collaboration diagram for PrivDES:
[legend]
List of all members.

Detailed Description

Encryption module using DES.

See also:
Priv

Definition at line 606 of file auth_priv.h.

Public Member Functions

int encrypt (const unsigned char *key, const unsigned int key_len, const unsigned char *buffer, const unsigned int buffer_len, unsigned char *out_buffer, unsigned int *out_buffer_len, unsigned char *privacy_params, unsigned int *privacy_params_len, const unsigned long engine_boots, const unsigned long engine_time)
 Encrypt the buffer with the given key.

int decrypt (const unsigned char *key, const unsigned int key_len, const unsigned char *buffer, const unsigned int buffer_len, unsigned char *out_buffer, unsigned int *out_buffer_len, const unsigned char *privacy_params, const unsigned int privacy_params_len, const unsigned long engine_boots, const unsigned long engine_time)
 Decrypt the buffer with the given key.

int get_id () const
 Get the uniqhe id of the privacy protocol.

const char * get_id_string () const
 Get the unique identifier string of the privacy protocol.

int get_priv_params_len () const
 Get the maximum length that is needed for the msgPrivacyParameters field.

int get_min_key_len () const
 Get the minimum key length needed for encryption and decryption.

void fix_key_len (unsigned int &key_len) const
 Decrease a too long length to the right value.


Member Function Documentation

int PrivDES::decrypt const unsigned char *  key,
const unsigned int  key_len,
const unsigned char *  buffer,
const unsigned int  buffer_len,
unsigned char *  out_buffer,
unsigned int *  out_buffer_len,
const unsigned char *  privacy_params,
const unsigned int  privacy_params_len,
const unsigned long  engine_boots,
const unsigned long  engine_time
[virtual]
 

Decrypt the buffer with the given key.

This method needs the privacy parameters field for the given message.

Parameters:
key - pointer to the (fixed length) dencryption key
key_len - length of encryption key
buffer - pointer to the encrypted buffer
buffer_len - length of the buffer
out_buffer - pointer to the buffer for the decryptet data
out_buffer_len - Input: Length of the output buffer. Output: Bytes written
privacy_params - Buffer, where the privacy parameters are read from.
privacy_params_len - Length of the privacy parameters buffer
engine_boots - The engine boots value for the message
engine_time - The engine time value for the message
Returns:
SNMPv3_USM_OK on success

Implements Priv.

int PrivDES::encrypt const unsigned char *  key,
const unsigned int  key_len,
const unsigned char *  buffer,
const unsigned int  buffer_len,
unsigned char *  out_buffer,
unsigned int *  out_buffer_len,
unsigned char *  privacy_params,
unsigned int *  privacy_params_len,
const unsigned long  engine_boots,
const unsigned long  engine_time
[virtual]
 

Encrypt the buffer with the given key.

This method fills the privacy parameters field of the given message.

Parameters:
key - pointer to the encryption key
key_len - length of encryption key
buffer - pointer to the unencrypted buffer
buffer_len - length of the buffer
out_buffer - pointer to the buffer for the encryptet data
out_buffer_len - Input: Length of the output buffer. Output: Bytes written
privacy_params - Buffer, where the privacy parameters are written to.
privacy_params_len - Length of the privacy parameters buffer
engine_boots - The engine boots value for the message
engine_time - The engine time value for the message
Returns:
SNMPv3_USM_OK on success

Implements Priv.

void PrivDES::fix_key_len unsigned int &  key_len  )  const [inline, virtual]
 

Decrease a too long length to the right value.

Implements Priv.

Definition at line 641 of file auth_priv.h.

int PrivDES::get_id  )  const [inline, virtual]
 

Get the uniqhe id of the privacy protocol.

Implements Priv.

Definition at line 637 of file auth_priv.h.

References SNMP_PRIVPROTOCOL_DES.

const char* PrivDES::get_id_string  )  const [inline, virtual]
 

Get the unique identifier string of the privacy protocol.

Implements Priv.

Definition at line 638 of file auth_priv.h.

int PrivDES::get_min_key_len  )  const [inline, virtual]
 

Get the minimum key length needed for encryption and decryption.

Implements Priv.

Definition at line 640 of file auth_priv.h.

int PrivDES::get_priv_params_len  )  const [inline, virtual]
 

Get the maximum length that is needed for the msgPrivacyParameters field.

Implements Priv.

Definition at line 639 of file auth_priv.h.


The documentation for this class was generated from the following file:
Generated on Tue Jan 4 22:42:19 2005 for SNMP++ by doxygen 1.3.2