Function

int cdk_armor_filter_use (CDK_STREAM inp )

Arguments

CDK_STREAM inp
the stream to check

Description


 

Function

int cdk_file_armor (CDK_HD hd , const char * file , const char * output )

Arguments

CDK_HD hd
Handle
const char * file
Name of the file to protect.
const char * output
Output filename.

Description


 

Function

int cdk_file_dearmor (const char * file , const char * output )

Arguments

const char * file
Name of the file to unprotect.
const char * output
Output filename.

Description


 

Function

int cdk_stream_encrypt (CDK_HD hd , CDK_STRLIST remusr , CDK_STREAM inp , CDK_STREAM out )

Arguments

CDK_HD hd
Handle
CDK_STRLIST remusr
List of recipients
CDK_STREAM inp
Input stream handle
CDK_STREAM out
Output stream handle

Description


 

Function

int cdk_file_encrypt (CDK_HD hd , CDK_STRLIST remusr , const char * file , const char * output )

Arguments

CDK_HD hd
Handle
CDK_STRLIST remusr
List of recipient
const char * file
Input file
const char * output
Output file

 

Function

int cdk_file_decrypt (CDK_HD hd , const char * file , const char * output )

Arguments

CDK_HD hd
Handle.
const char * file
Name of the file to decrypt.
const char * output
Output filename.

Description


 

Function

int cdk_data_transform (CDK_HD hd , int mode , CDK_STRLIST locusr , CDK_STRLIST remusr , const void * inbuf , size_t insize , byte ** outbuf , size_t * outsize , int modval )

Arguments

CDK_HD hd
session handle
int mode
crypto mode
CDK_STRLIST locusr
local user list (sign mode only)
CDK_STRLIST remusr
remote users 'recipients'
const void * inbuf
input buffer with data
size_t insize
length of data in bytes
byte ** outbuf
pointer to the output data (will be allocated)
size_t * outsize
size of the new data in bytes
int modval
value for the modus (for example sign mode)

Description


 

Function

CDK_KBNODE cdk_kbnode_new (CDK_PACKET * pkt )

Arguments

CDK_PACKET * pkt
the packet to add

Description


 

Function

void cdk_kbnode_release (CDK_KBNODE node )

Arguments

CDK_KBNODE node

Description


 

Function

void cdk_kbnode_delete (CDK_KBNODE node )

Arguments

CDK_KBNODE node
the ke keynode.

Description


 

Function

void cdk_kbnode_insert (CDK_KBNODE root , CDK_KBNODE node , int pkttype )

Arguments

CDK_KBNODE root
the root key node
CDK_KBNODE node
the node to add
int pkttype
packet type

Description


 

Function

CDK_KBNODE cdk_kbnode_find_prev (CDK_KBNODE root , CDK_KBNODE node , int pkttype )

Arguments

CDK_KBNODE root
the root key node
CDK_KBNODE node
the key node
int pkttype
packet type

Description


 

Function

CDK_KBNODE cdk_kbnode_find_next (CDK_KBNODE node , int pkttype )

Arguments

CDK_KBNODE node
the key node
int pkttype
packet type

Description

the valid ordering of packets


 

Function

CDK_KBNODE cdk_kbnode_find (CDK_KBNODE node , int pkttype )

Arguments

CDK_KBNODE node
the key node
int pkttype
packet type

Description


 

Function

CDK_PACKET* cdk_kbnode_find_packet (CDK_KBNODE node , int pkttype )

Arguments

CDK_KBNODE node
the key node
int pkttype
packet type

Description


 

Function

CDK_PACKET * cdk_kbnode_get_packet (CDK_KBNODE node )

Arguments

CDK_KBNODE node
the key node

Description


 

Function

int cdk_kbnode_read_from_mem (CDK_KBNODE * ret_node , const byte * buf , size_t buflen )

Arguments

CDK_KBNODE * ret_node
the new key node
const byte * buf
the buffer which stores the key sequence
size_t buflen
the length of the buffer

Description


 

Function

int cdk_kbnode_write_to_mem (CDK_KBNODE node , byte * buf , size_t * r_nbytes )

Arguments

CDK_KBNODE node
the key node
byte * buf
the buffer to store the node data
size_t * r_nbytes
the new length of the buffer.

Description


 

Function

int cdk_keydb_idx_rebuild (CDK_KEYDB_HD hd )

Arguments

CDK_KEYDB_HD hd
key database handle

Description


 

Function

int cdk_keydb_new (CDK_KEYDB_HD * r_hd , int type , void * data , size_t count )

Arguments

CDK_KEYDB_HD * r_hd
handle to store the new keydb object
int type
type of the keyring
void * data
data which depends on the keyring type
size_t count
length of the data

Description


 

Function

void cdk_keydb_free (CDK_KEYDB_HD hd )

Arguments

CDK_KEYDB_HD hd
the keydb object

Description


 

Function

int cdk_keydb_open (CDK_KEYDB_HD hd , CDK_STREAM * ret_kr )

Arguments

CDK_KEYDB_HD hd
keydb object
CDK_STREAM * ret_kr
the STREAM object which contains the data of the keyring

Description


 

Function

int cdk_keydb_search_new (CDK_DBSEARCH * r_dbs , int type , void * desc )

Arguments

CDK_DBSEARCH * r_dbs
object to store the new keydb search object
int type
specifies the search type
void * desc
description which depends on the type

Description


 

Function

void cdk_keydb_search_free (CDK_DBSEARCH dbs )

Arguments

CDK_DBSEARCH dbs
the keydb search object

Description


 

Function

int cdk_keydb_search (CDK_KEYDB_HD hd , CDK_DBSEARCH ks , CDK_KBNODE * ret_key )

Arguments

CDK_KEYDB_HD hd
the keydb object
CDK_DBSEARCH ks
the keydb search object
CDK_KBNODE * ret_key
kbnode object to store the key

Description


 

Function

int cdk_keygen_set_prefs (CDK_KEYGEN_CTX hd , int type , const byte * array , size_t n )

Arguments

CDK_KEYGEN_CTX hd
the preference type
int type
const byte * array
one-octet array with algorithm numers
size_t n

 

Function

void cdk_keygen_set_name (CDK_KEYGEN_CTX hd , const char * name )

Arguments

CDK_KEYGEN_CTX hd
the keygen object
const char * name
name

Description


 

Function

int cdk_keygen_set_algo_info (CDK_KEYGEN_CTX hd , int type , int algo , int bits )

Arguments

CDK_KEYGEN_CTX hd
the keygen object.
int type
key type (primary=0, subkey=1)
int algo
algorithm compliant with rfc2440
int bits
lengt of the key in bits

 

Function

void cdk_keygen_set_mdc_feature (CDK_KEYGEN_CTX hd , int val )

Arguments

CDK_KEYGEN_CTX hd
keygen object
int val
boolean( yes=1, no=0)

Description


 

Function

void cdk_keygen_set_expire_date (CDK_KEYGEN_CTX hd , int type , long timestamp )

Arguments

CDK_KEYGEN_CTX hd
keygen object
int type
key type( 0=primary, 1=seconardy)
long timestamp
the date the key should expire

 

Function

int cdk_keygen_start (CDK_KEYGEN_CTX hd )

Arguments

CDK_KEYGEN_CTX hd
the keygen object

 

Function

int cdk_keygen_save (CDK_KEYGEN_CTX hd , const char * pub , const char * sec )

Arguments

CDK_KEYGEN_CTX hd
the keygen object
const char * pub
name of the file to store the public key
const char * sec
name of the file to store the secret key

 

Function

void cdk_keygen_free (CDK_KEYGEN_CTX hd )

Arguments

CDK_KEYGEN_CTX hd
the keygen object

 

Function

int cdk_keygen_new (CDK_KEYGEN_CTX * r_hd )

Arguments

CDK_KEYGEN_CTX * r_hd
the new object

 

Function

int cdk_pklist_select_algo (CDK_KEYLIST pkl )

Arguments

CDK_KEYLIST pkl
the keylist

Description


 

Function

void cdk_pklist_release (CDK_KEYLIST pkl )

Arguments

CDK_KEYLIST pkl
the keylist

Description


 

Function

int cdk_pklist_build (CDK_KEYDB_HD hd , CDK_STRLIST remusr , CDK_KEYLIST * ret_pkl , int use )

Arguments

CDK_KEYDB_HD hd
the session handle
CDK_STRLIST remusr
the string list of the recipients
CDK_KEYLIST * ret_pkl
the new keylist
int use
public key usage

Description


 

Function

int cdk_pklist_encrypt (CDK_KEYLIST pkl , CDK_DEK dek , CDK_STREAM outp )

Arguments

CDK_KEYLIST pkl
the keylist
CDK_DEK dek
the data encryption key
CDK_STREAM outp
the stream to write in the data

Description


 

Function

void cdk_sklist_release (CDK_KEYLIST skl )

Arguments

CDK_KEYLIST skl
secret keylist

Description


 

Function

int cdk_sklist_write_onepass (CDK_KEYLIST skl , CDK_STREAM outp , int sigclass , int mdalgo )

Arguments

CDK_KEYLIST skl
secret keylist
CDK_STREAM outp
the stream to write in the data
int sigclass
the class of the sig to create
int mdalgo
the message digest algorithm

Description


 

Function

int cdk_sklist_write (CDK_KEYLIST skl , CDK_STREAM outp , void * mdctx , int sigclass , int sigver )

Arguments

CDK_KEYLIST skl
secret keylist
CDK_STREAM outp
the stream to write in the data
void * mdctx
opaque handle for the message digest operations
int sigclass
the class of the sig
int sigver
version of the sig

Description


 

Function

int cdk_keyserver_recv_key (const char * host , int port , const byte * keyid , int kid_type , CDK_KBNODE * ret_key )

Arguments

const char * host
URL or hostname of the keyserver
int port
The port to use for the connection
const byte * keyid
KeyID of the key to retrieve
int kid_type
KeyID type (long, short, fingerprint)
CDK_KBNODE * ret_key

Description


 

Function

const char * cdk_strerror (int ec )

Arguments

int ec
the error number

Description


 

Function

void cdk_set_malloc_hooks (void * (*new_alloc_func )

Arguments

void * (*new_alloc_func

Description


 

Function

int cdk_malloc_hook_initialized ( void )

Arguments

void

Description


 

Function

void cdk_set_log_handler (CDK_LOG_FNC logfnc , void * opaque )

Arguments

CDK_LOG_FNC logfnc
the function pointer
void * opaque
a private values for the function

Description


 

Function

void cdk_set_log_level (int lvl )

Arguments

int lvl
the level

Description


 

Function

int cdk_handle_control (CDK_HD hd , int action , int cmd , ... )

Arguments

CDK_HD hd
session handle
int action
flag which indicates whether put or get is requested
int cmd
command id
...

Description


 

Function

int cdk_handle_new (CDK_HD * r_ctx )

Arguments

CDK_HD * r_ctx
context to store the handle

Description


 

Function

void cdk_handle_set_keydb (CDK_HD hd , CDK_KEYDB_HD db )

Arguments

CDK_HD hd
session handle
CDK_KEYDB_HD db
the database handle

Description


 

Function

CDK_KEYDB_HD cdk_handle_get_keydb (CDK_HD hd , int type )

Arguments

CDK_HD hd
session handle
int type
type of the keyring

Description


 

Function

void cdk_handle_set_callback (CDK_HD hd , void (*cb )

Arguments

CDK_HD hd
the handle
void (*cb

Description


 

Function

void cdk_handle_set_passphrase_cb (CDK_HD hd , char * (*cb )

Arguments

CDK_HD hd
session handle
char * (*cb

Description


 

Function

void cdk_handle_free (CDK_HD hd )

Arguments

CDK_HD hd
the handle

Description


 

Function

const char * cdk_check_version (const char * req_version )

Arguments

const char * req_version
The requested version

Description


 

Function

int cdk_pk_encrypt (cdkPKT_public_key * pk , cdkPKT_pubkey_enc * pke , CDK_SESSKEY esk )

Arguments

cdkPKT_public_key * pk
the public key
cdkPKT_pubkey_enc * pke
the public key encrypted packet
CDK_SESSKEY esk
the actual session key

Description


 

Function

int cdk_pk_decrypt (cdkPKT_secret_key * sk , cdkPKT_pubkey_enc * pke , CDK_SESSKEY * r_sk )

Arguments

cdkPKT_secret_key * sk
the secret key
cdkPKT_pubkey_enc * pke
public key encrypted packet
CDK_SESSKEY * r_sk
the object to store the plain session key

Description


 

Function

int cdk_pk_sign (cdkPKT_secret_key * sk , cdkPKT_signature * sig , const byte * md )

Arguments

cdkPKT_secret_key * sk
secret key
cdkPKT_signature * sig
signature
const byte * md
the message digest

Description


 

Function

int cdk_pk_verify (cdkPKT_public_key * pk , cdkPKT_signature * sig , const byte * md )

Arguments

cdkPKT_public_key * pk
the public key
cdkPKT_signature * sig
signature
const byte * md
the message digest

Description


 

Function

int cdk_pk_from_secret_key (cdkPKT_secret_key * sk , cdkPKT_public_key ** ret_pk )

Arguments

cdkPKT_secret_key * sk
the secret key
cdkPKT_public_key ** ret_pk
the new public key

Description


 

Function

int cdk_pkt_parse (CDK_STREAM inp , CDK_PACKET * pkt )

Arguments

CDK_STREAM inp
the input stream
CDK_PACKET * pkt
allocated packet handle to store the packet

Description


 

Function

int cdk_pk_check_sigs (CDK_KBNODE knode , CDK_KEYDB_HD hd , int * r_status )

Arguments

CDK_KBNODE knode
the key node
CDK_KEYDB_HD hd
the session handle
int * r_status
variable to store the status of the key

Description


 

Function

int cdk_stream_sign (CDK_HD hd , CDK_STREAM inp , CDK_STREAM out , CDK_STRLIST locusr , CDK_STRLIST remusr , int encryptflag , int sigmode )

Arguments

CDK_HD hd
session handle
CDK_STREAM inp
input stream
CDK_STREAM out
output stream
CDK_STRLIST locusr
local user list for signing
CDK_STRLIST remusr
int encryptflag
shall the output be encrypted? (1/0)
int sigmode
signature mode

Description


 

Function

int cdk_file_sign (CDK_HD hd , CDK_STRLIST locusr , CDK_STRLIST remusr , const char * file , const char * output , int sigmode , int encryptflag )

Arguments

CDK_HD hd
CDK_STRLIST locusr
List of userid which should be used for signing
CDK_STRLIST remusr
If encrypt is valid, the list of recipients
const char * file
Name of the input file
const char * output
Name of the output file
int sigmode
Signature mode
int encryptflag

Description


 

Function

int cdk_stream_open (const char * file , CDK_STREAM * ret_s )

Arguments

const char * file
The file to open
CDK_STREAM * ret_s
The new STREAM object

 

Function

int cdk_stream_new (const char * file , CDK_STREAM * ret_s )

Arguments

const char * file
The name of the new file
CDK_STREAM * ret_s
The new STREAM object

 

Function

int cdk_stream_create (const char * file , CDK_STREAM * ret_s )

Arguments

const char * file
the filename
CDK_STREAM * ret_s
the object

Description


 

Function

int cdk_stream_close (CDK_STREAM s )

Arguments

CDK_STREAM s
The STREAM object.

Description


 

Function

int cdk_stream_eof (CDK_STREAM s )

Arguments

CDK_STREAM s
The STREAM object.

Description


 

Function

unsigned cdk_stream_get_length (CDK_STREAM s )

Arguments

CDK_STREAM s
The STREAM object.

Description


 

Function

int cdk_stream_filter_disable (CDK_STREAM s , int type )

Arguments

CDK_STREAM s
The STREAM object
int type
The numberic filter ID.

 

Function

int cdk_stream_read (CDK_STREAM s , void * buf , size_t count )

Arguments

CDK_STREAM s
The STREAM object.
void * buf
The buffer to insert the readed bytes.
size_t count
Request so much bytes.

Description


 

Function

int cdk_stream_write (CDK_STREAM s , const void * buf , size_t count )

Arguments

CDK_STREAM s
The STREAM object
const void * buf
The buffer with the values to write.
size_t count
The size of the buffer.

Description


 

Function

int cdk_stream_mmap (CDK_STREAM s , byte ** ret_buf , size_t * ret_count )

Arguments

CDK_STREAM s
the stream
byte ** ret_buf
the buffer to store the content
size_t * ret_count
length of the buffer

Description


 

Function

int cdk_file_verify (CDK_HD hd , const char * file , const char * output )

Arguments

CDK_HD hd
the session handle
const char * file
the input file
const char * output
the output file

Description


 

Function

byte * cdk_sig_get_info_as_xml (CDK_HD hd , int advanced )

Arguments

CDK_HD hd
session handle
int advanced
flag to indicate whether to include extended data

Description


 

Function

u32 cdk_sig_get_ulong_attr (CDK_HD hd , int idx , int what )

Arguments

CDK_HD hd
session handle
int idx
index of the signature
int what
attribute id

Description


 

Function

const void * cdk_sig_get_data_attr (CDK_HD hd , int idx , int what )

Arguments

CDK_HD hd
session handle
int idx
index of the signature
int what
attribute id.

Description


 

Function

int cdk_pkt_build (CDK_STREAM out , CDK_PACKET * pkt )

Arguments

CDK_STREAM out
the output stream handle
CDK_PACKET * pkt
the packet itself

Description