Function

cdk_error_t cdk_armor_filter_use (cdk_stream_t inp )

Arguments

cdk_stream_t inp
the stream to check

Description


 

Function

cdk_error_t cdk_file_armor (cdk_ctx_t hd , const char * file , const char * output )

Arguments

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

Description


 

Function

cdk_error_t 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

cdk_error_t cdk_stream_encrypt (cdk_ctx_t hd , cdk_strlist_t remusr , cdk_stream_t inp , cdk_stream_t out )

Arguments

cdk_ctx_t hd
Handle
cdk_strlist_t remusr
List of recipients
cdk_stream_t inp
Input stream handle
cdk_stream_t out
Output stream handle

Description


 

Function

cdk_error_t cdk_file_encrypt (cdk_ctx_t hd , cdk_strlist_t remusr , const char * file , const char * output )

Arguments

cdk_ctx_t hd
Handle
cdk_strlist_t remusr
List of recipient
const char * file
Input file
const char * output
Output file

 

Function

cdk_error_t cdk_file_decrypt (cdk_ctx_t hd , const char * file , const char * output )

Arguments

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

Description


 

Function

cdk_error_t cdk_data_transform (cdk_ctx_t hd , enum cdk_crypto_mode_t mode , cdk_strlist_t locusr , cdk_strlist_t remusr , const void * inbuf , size_t insize , byte ** outbuf , size_t * outsize , int modval )

Arguments

cdk_ctx_t hd
session handle
enum cdk_crypto_mode_t mode
crypto mode
cdk_strlist_t locusr
local user list (sign mode only)
cdk_strlist_t 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_t cdk_kbnode_new (cdk_packet_t pkt )

Arguments

cdk_packet_t pkt
the packet to add

Description


 

Function

void cdk_kbnode_release (cdk_kbnode_t node )

Arguments

cdk_kbnode_t node

Description


 

Function

void cdk_kbnode_delete (cdk_kbnode_t node )

Arguments

cdk_kbnode_t node
the ke keynode.

Description


 

Function

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

Arguments

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

Description


 

Function

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

Arguments

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

Description


 

Function

cdk_kbnode_t cdk_kbnode_find_next (cdk_kbnode_t node , int pkttype )

Arguments

cdk_kbnode_t node
the key node
int pkttype
packet type

Description

the valid ordering of packets


 

Function

cdk_kbnode_t cdk_kbnode_find (cdk_kbnode_t node , int pkttype )

Arguments

cdk_kbnode_t node
the key node
int pkttype
packet type

Description


 

Function

cdk_packet_t cdk_kbnode_find_packet (cdk_kbnode_t node , int pkttype )

Arguments

cdk_kbnode_t node
the key node
int pkttype
packet type

Description


 

Function

cdk_packet_t cdk_kbnode_get_packet (cdk_kbnode_t node )

Arguments

cdk_kbnode_t node
the key node

Description


 

Function

cdk_error_t cdk_kbnode_read_from_mem (cdk_kbnode_t * ret_node , const byte * buf , size_t buflen )

Arguments

cdk_kbnode_t * 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

cdk_error_t cdk_kbnode_write_to_mem (cdk_kbnode_t node , byte * buf , size_t * r_nbytes )

Arguments

cdk_kbnode_t 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

void * cdk_kbnode_get_attr (cdk_kbnode_t node , int pkttype , int attr )

Arguments

cdk_kbnode_t node
the key node
int pkttype
the packet type which the attribute should be retrieved from
int attr
the attribute to retrive

Description


 

Function

cdk_error_t cdk_kbnode_hash (cdk_kbnode_t node , cdk_md_hd_t md , int is_v4 , int pkttype , int flags )

Arguments

cdk_kbnode_t node
the key node
cdk_md_hd_t md
int is_v4
OpenPGP signature (yes=1, no=0)
int pkttype
packet type to hash (if zero use the packet type from the node)
int flags
flags which depend on the operation

Description


 

Function

cdk_error_t cdk_keydb_idx_rebuild (cdk_keydb_hd_t hd )

Arguments

cdk_keydb_hd_t hd
key database handle

Description


 

Function

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

Arguments

cdk_keydb_hd_t * 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_t hd )

Arguments

cdk_keydb_hd_t hd
the keydb object

Description


 

Function

cdk_error_t cdk_keydb_open (cdk_keydb_hd_t hd , cdk_stream_t * ret_kr )

Arguments

cdk_keydb_hd_t hd
keydb object
cdk_stream_t * ret_kr
the STREAM object which contains the data of the keyring

Description


 

Function

cdk_error_t cdk_keydb_search_start (cdk_keydb_hd_t db , int type , void * desc )

Arguments

cdk_keydb_hd_t db
key database handle
int type
specifies the search type
void * desc
description which depends on the type

Description


 

Function

cdk_error_t cdk_keydb_search (cdk_keydb_hd_t hd , cdk_kbnode_t * ret_key )

Arguments

cdk_keydb_hd_t hd
the keydb object
cdk_kbnode_t * ret_key
kbnode object to store the key

Description


 

Function

cdk_error_t cdk_listkey_start (cdk_listkey_t * r_ctx , cdk_keydb_hd_t db , const char * patt , cdk_strlist_t fpatt )

Arguments

cdk_listkey_t * r_ctx
pointer to store the new context
cdk_keydb_hd_t db
the key database handle
const char * patt
string pattern
cdk_strlist_t fpatt
recipients from a stringlist to show

Description


 

Function

void cdk_listkey_close (cdk_listkey_t ctx )

Arguments

cdk_listkey_t ctx
the list key context

Description


 

Function

cdk_error_t cdk_listkey_next (cdk_listkey_t ctx , cdk_kbnode_t * ret_key )

Arguments

cdk_listkey_t ctx
list key context
cdk_kbnode_t * ret_key

Description


 

Function

cdk_error_t cdk_keygen_set_prefs (cdk_keygen_ctx_t hd , enum cdk_pref_type_t type , const byte * array , size_t n )

Arguments

cdk_keygen_ctx_t hd
the preference type
enum cdk_pref_type_t type
const byte * array
one-octet array with algorithm numers
size_t n

 

Function

void cdk_keygen_set_name (cdk_keygen_ctx_t hd , const char * name )

Arguments

cdk_keygen_ctx_t hd
the keygen object
const char * name
name

Description


 

Function

cdk_error_t cdk_keygen_set_algo_info (cdk_keygen_ctx_t hd , int type , enum cdk_pk_algo_t algo , int bits )

Arguments

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

 

Function

void cdk_keygen_set_mdc_feature (cdk_keygen_ctx_t hd , int val )

Arguments

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

Description


 

Function

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

Arguments

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

 

Function

cdk_error_t cdk_keygen_start (cdk_keygen_ctx_t hd )

Arguments

cdk_keygen_ctx_t hd
the keygen object

 

Function

cdk_error_t cdk_keygen_save (cdk_keygen_ctx_t hd , const char * pubf , const char * secf )

Arguments

cdk_keygen_ctx_t hd
the keygen object
const char * pubf
const char * secf

 

Function

void cdk_keygen_free (cdk_keygen_ctx_t hd )

Arguments

cdk_keygen_ctx_t hd
the keygen object

 

Function

cdk_error_t cdk_keygen_new (cdk_keygen_ctx_t * r_hd )

Arguments

cdk_keygen_ctx_t * r_hd
the new object

 

Function

int cdk_pklist_select_algo (cdk_keylist_t pkl , int preftype )

Arguments

cdk_keylist_t pkl
the keylist
int preftype
preference type

Description


 

Function

void cdk_pklist_release (cdk_keylist_t pkl )

Arguments

cdk_keylist_t pkl
the keylist

Description


 

Function

cdk_error_t cdk_pklist_build (cdk_keylist_t * ret_pkl , cdk_keydb_hd_t hd , cdk_strlist_t remusr , int use )

Arguments

cdk_keylist_t * ret_pkl
the new keylist
cdk_keydb_hd_t hd
the session handle
cdk_strlist_t remusr
the string list of the recipients
int use
public key usage

Description


 

Function

cdk_error_t cdk_pklist_encrypt (cdk_keylist_t pk_list , cdk_dek_t dek , cdk_stream_t outp )

Arguments

cdk_keylist_t pk_list
cdk_dek_t dek
the data encryption key
cdk_stream_t outp
the stream to write in the data

Description


 

Function

void cdk_sklist_release (cdk_keylist_t sk_list )

Arguments

cdk_keylist_t sk_list

Description


 

Function

cdk_error_t cdk_sklist_write_onepass (cdk_keylist_t skl , cdk_stream_t outp , int sigclass , int mdalgo )

Arguments

cdk_keylist_t skl
secret keylist
cdk_stream_t 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

cdk_error_t cdk_sklist_write (cdk_keylist_t skl , cdk_stream_t outp , cdk_md_hd_t hash , int sigclass , int sigver )

Arguments

cdk_keylist_t skl
secret keylist
cdk_stream_t outp
the stream to write in the data
cdk_md_hd_t hash
opaque handle for the message digest operations
int sigclass
the class of the sig
int sigver
version of the sig

Description


 

Function

cdk_error_t cdk_keyserver_recv_key (const char * host , int port , const byte * keyid , int kid_type , cdk_kbnode_t * 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_t * 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_t logfnc , void * opaque )

Arguments

cdk_log_fnc_t 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_ctx_t hd , int action , int cmd , ... )

Arguments

cdk_ctx_t 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_ctx_t * r_ctx )

Arguments

cdk_ctx_t * r_ctx
context to store the handle

Description


 

Function

void cdk_handle_set_keydb (cdk_ctx_t hd , cdk_keydb_hd_t db )

Arguments

cdk_ctx_t hd
session handle
cdk_keydb_hd_t db
the database handle

Description


 

Function

cdk_keydb_hd_t cdk_handle_get_keydb (cdk_ctx_t hd , int type )

Arguments

cdk_ctx_t hd
session handle
int type
type of the keyring

Description


 

Function

void cdk_handle_set_callback (cdk_ctx_t hd , void (*cb )

Arguments

cdk_ctx_t hd
the handle
void (*cb

Description


 

Function

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

Arguments

cdk_ctx_t hd
session handle
char * (*cb

Description


 

Function

void cdk_handle_free (cdk_ctx_t hd )

Arguments

cdk_ctx_t hd
the handle

Description


 

Function

const char * cdk_check_version (const char * req_version )

Arguments

const char * req_version
The requested version

Description


 

Function

void cdk_subpkt_free (cdk_subpkt_t ctx )

Arguments

cdk_subpkt_t ctx
the sub packet node to free

Description


 

Function

cdk_subpkt_t cdk_subpkt_find (cdk_subpkt_t ctx , int type )

Arguments

cdk_subpkt_t ctx
the sub packet node
int type
the packet type to find

Description


 

Function

cdk_subpkt_t cdk_subpkt_new (size_t size )

Arguments

size_t size
the size of the new context

Description


 

Function

const byte * cdk_subpkt_get_data (cdk_subpkt_t ctx , int * r_type , size_t * r_nbytes )

Arguments

cdk_subpkt_t ctx
the sub packet node
int * r_type
pointer store the packet type
size_t * r_nbytes
pointer to store the packet size

Description


 

Function

cdk_error_t cdk_subpkt_add (cdk_subpkt_t root , cdk_subpkt_t node )

Arguments

cdk_subpkt_t root
the root node
cdk_subpkt_t node
the node to add

Description


 

Function

void cdk_subpkt_init (cdk_subpkt_t node , int type , const void * buf , size_t buflen )

Arguments

cdk_subpkt_t node
the sub packet node
int type
type of the packet which data should be initialized
const void * buf
the buffer with the actual data
size_t buflen
the size of the data

Description


 

Function

cdk_error_t cdk_pk_encrypt (cdk_pkt_pubkey_t pk , cdk_pkt_pubkey_enc_t pke , cdk_sesskey_t esk )

Arguments

cdk_pkt_pubkey_t pk
the public key
cdk_pkt_pubkey_enc_t pke
the public key encrypted packet
cdk_sesskey_t esk
the actual session key

Description


 

Function

cdk_error_t cdk_pk_decrypt (cdk_pkt_seckey_t sk , cdk_pkt_pubkey_enc_t pke , cdk_sesskey_t * r_sk )

Arguments

cdk_pkt_seckey_t sk
the secret key
cdk_pkt_pubkey_enc_t pke
public key encrypted packet
cdk_sesskey_t * r_sk
the object to store the plain session key

Description


 

Function

cdk_error_t cdk_pk_sign (cdk_pkt_seckey_t sk , cdk_pkt_signature_t sig , const byte * md )

Arguments

cdk_pkt_seckey_t sk
secret key
cdk_pkt_signature_t sig
signature
const byte * md
the message digest

Description


 

Function

cdk_error_t cdk_pk_verify (cdk_pkt_pubkey_t pk , cdk_pkt_signature_t sig , const byte * md )

Arguments

cdk_pkt_pubkey_t pk
the public key
cdk_pkt_signature_t sig
signature
const byte * md
the message digest

Description


 

Function

cdk_error_t cdk_pk_from_secret_key (cdk_pkt_seckey_t sk , cdk_pkt_pubkey_t* ret_pk )

Arguments

cdk_pkt_seckey_t sk
the secret key
cdk_pkt_pubkey_t* ret_pk
the new public key

Description


 

Function

cdk_error_t cdk_pkt_read (cdk_stream_t inp , cdk_packet_t pkt )

Arguments

cdk_stream_t inp
the input stream
cdk_packet_t pkt
allocated packet handle to store the packet

Description


 

Function

cdk_error_t cdk_pk_check_sigs (cdk_kbnode_t knode , cdk_keydb_hd_t hd , int * r_status )

Arguments

cdk_kbnode_t knode
the key node
cdk_keydb_hd_t hd
the session handle
int * r_status
variable to store the status of the key

Description


 

Function

cdk_error_t cdk_stream_sign (cdk_ctx_t hd , cdk_stream_t inp , cdk_stream_t out , cdk_strlist_t locusr , cdk_strlist_t remusr , int encryptflag , int sigmode )

Arguments

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

Description


 

Function

cdk_error_t cdk_file_sign (cdk_ctx_t hd , cdk_strlist_t locusr , cdk_strlist_t remusr , const char * file , const char * output , int sigmode , int encryptflag )

Arguments

cdk_ctx_t hd
cdk_strlist_t locusr
List of userid which should be used for signing
cdk_strlist_t 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

cdk_error_t cdk_stream_open (const char * file , cdk_stream_t * ret_s )

Arguments

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

 

Function

cdk_error_t cdk_stream_new (const char * file , cdk_stream_t * ret_s )

Arguments

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

 

Function

cdk_error_t cdk_stream_create (const char * file , cdk_stream_t * ret_s )

Arguments

const char * file
the filename
cdk_stream_t * ret_s
the object

Description


 

Function

cdk_error_t cdk_stream_close (cdk_stream_t s )

Arguments

cdk_stream_t s
The STREAM object.

Description


 

Function

int cdk_stream_eof (cdk_stream_t s )

Arguments

cdk_stream_t s
The STREAM object.

Description


 

Function

unsigned cdk_stream_get_length (cdk_stream_t s )

Arguments

cdk_stream_t s
The STREAM object.

Description


 

Function

cdk_error_t cdk_stream_filter_disable (cdk_stream_t s , int type )

Arguments

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

 

Function

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

Arguments

cdk_stream_t 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_t s , const void * buf , size_t count )

Arguments

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

Description


 

Function

cdk_error_t cdk_stream_mmap (cdk_stream_t s , byte ** ret_buf , size_t * ret_count )

Arguments

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

Description


 

Function

int cdk_stream_peek (cdk_stream_t inp , byte * s , size_t count )

Arguments

cdk_stream_t inp
the input stream handle
byte * s
buffer
size_t count
number of bytes to peek

Description


 

Function

cdk_error_t cdk_file_verify (cdk_ctx_t hd , const char * file , const char * output )

Arguments

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

Description


 

Function

unsigned long cdk_sig_get_ulong_attr (cdk_ctx_t hd , int idx , int what )

Arguments

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

Description


 

Function

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

Arguments

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

Description


 

Function

cdk_error_t cdk_pkt_write (cdk_stream_t out , cdk_packet_t pkt )

Arguments

cdk_stream_t out
the output stream handle
cdk_packet_t pkt
the packet itself

Description