Keys and Keyrings
[Core API]


Functions

void ops_fingerprint (ops_fingerprint_t *fp, const ops_public_key_t *key)
 Calculate a public key fingerprint.
void ops_keyid (unsigned char keyid[8], const ops_public_key_t *key)
 Calculate the Key ID from the public key.
void ops_copy_userid (ops_user_id_t *dst, const ops_user_id_t *src)
 Copy user id, including contents.
void ops_copy_packet (ops_packet_t *dst, const ops_packet_t *src)
 Copy packet, including contents.
void ops_keydata_copy (ops_keydata_t *dst, const ops_keydata_t *src)
 Copies entire key data.
ops_secret_key_tops_decrypt_secret_key_from_data (const ops_keydata_t *key, const char *pphrase)
 Decrypts secret key from given keydata with given passphrase.
void ops_set_secret_key (ops_parser_content_union_t *content, const ops_keydata_t *key)
 Set secret key in content.
const unsigned char * ops_get_key_id (const ops_keydata_t *key)
 Get Key ID from keydata.
unsigned ops_get_user_id_count (const ops_keydata_t *key)
 How many User IDs in this key?
const unsigned char * ops_get_user_id (const ops_keydata_t *key, unsigned index)
 Get indexed user id from key.
ops_user_id_tops_add_userid_to_keydata (ops_keydata_t *keydata, const ops_user_id_t *userid)
 Add User ID to keydata.
ops_packet_tops_add_packet_to_keydata (ops_keydata_t *keydata, const ops_packet_t *packet)
 Add packet to key.
void ops_add_signed_userid_to_keydata (ops_keydata_t *keydata, const ops_user_id_t *user_id, const ops_packet_t *sigpacket)
 Add signed User ID to key.
ops_boolean_t ops_add_selfsigned_userid_to_keydata (ops_keydata_t *keydata, ops_user_id_t *userid)
 Add selfsigned User ID to key.
void ops_keydata_init (ops_keydata_t *keydata, const ops_content_tag_t type)
 Initialise ops_keydata_t.

Function Documentation

ops_packet_t* ops_add_packet_to_keydata ops_keydata_t keydata,
const ops_packet_t packet
 

Add packet to key.

Parameters:
keydata Key to which to add packet
packet Packet to add
Returns:
Pointer to new packet

ops_boolean_t ops_add_selfsigned_userid_to_keydata ops_keydata_t keydata,
ops_user_id_t userid
 

Add selfsigned User ID to key.

Parameters:
keydata Key to which to add user ID
userid Self-signed User ID to add
Returns:
ops_true if OK; else ops_false

void ops_add_signed_userid_to_keydata ops_keydata_t keydata,
const ops_user_id_t user_id,
const ops_packet_t sigpacket
 

Add signed User ID to key.

Parameters:
keydata Key to which to add signed User ID
user_id User ID to add
sigpacket Packet to add

ops_user_id_t* ops_add_userid_to_keydata ops_keydata_t keydata,
const ops_user_id_t userid
 

Add User ID to keydata.

Parameters:
keydata Key to which to add User ID
userid User ID to add
Returns:
Pointer to new User ID

void ops_copy_packet ops_packet_t dst,
const ops_packet_t src
 

Copy packet, including contents.

Parameters:
dst Destination packet
src Source packet
Note:
If dst already has a packet, it will be freed.

void ops_copy_userid ops_user_id_t dst,
const ops_user_id_t src
 

Copy user id, including contents.

Parameters:
dst Destination User ID
src Source User ID
Note:
If dst already has a user_id, it will be freed.

ops_secret_key_t* ops_decrypt_secret_key_from_data const ops_keydata_t key,
const char *  pphrase
 

Decrypts secret key from given keydata with given passphrase.

Parameters:
key Key from which to get secret key
pphrase Passphrase to use to decrypt secret key
Returns:
secret key

void ops_fingerprint ops_fingerprint_t fp,
const ops_public_key_t key
 

Calculate a public key fingerprint.

Parameters:
fp Where to put the calculated fingerprint
key The key for which the fingerprint is calculated

const unsigned char* ops_get_key_id const ops_keydata_t key  ) 
 

Get Key ID from keydata.

Parameters:
key Keydata to get Key ID from
Returns:
Pointer to Key ID inside keydata

const unsigned char* ops_get_user_id const ops_keydata_t key,
unsigned  index
 

Get indexed user id from key.

Parameters:
key Key to get user id from
index Which key to get
Returns:
Pointer to requested user id

unsigned ops_get_user_id_count const ops_keydata_t key  ) 
 

How many User IDs in this key?

Parameters:
key Keydata to check
Returns:
Num of user ids

void ops_keydata_copy ops_keydata_t dst,
const ops_keydata_t src
 

Copies entire key data.

Parameters:
dst Destination key where to copy
src Source key to copy

void ops_keydata_init ops_keydata_t keydata,
const ops_content_tag_t  type
 

Initialise ops_keydata_t.

Parameters:
keydata Keydata to initialise
type OPS_PTAG_CT_PUBLIC_KEY or OPS_PTAG_CT_SECRET_KEY

void ops_keyid unsigned char  keyid[8],
const ops_public_key_t key
 

Calculate the Key ID from the public key.

Parameters:
keyid Space for the calculated ID to be stored
key The key for which the ID is calculated

void ops_set_secret_key ops_parser_content_union_t content,
const ops_keydata_t key
 

Set secret key in content.

Parameters:
content Content to be set
key Keydata to get secret key from


Generated on Sun May 26 00:00:02 2013 for OpenPGP:SDK by  doxygen 1.4.6