Arguments: 

• key_id , user_id : Null-terminated strings that as a pair form a unique identifier indicating which key to fetch. 

• key_type : The address of a buffer pointer. The function stores into it a pointer to a null-terminated string that provides additional information about the key (stored when the key was added). 

• key : The address of a buffer pointer. The function stores into it a pointer to the buffer containing the fetched key data. 

• key_len : The address of a variable into which the function stores the size in bytes of the *key  buffer. 

Return value: 

Returns 0 for success, 1 for failure. 

• my_key_generate() 

Generates a new random key of a given type and length and stores it in the keyring. The key has a length of key_len  and is associated with the identifier formed from key_id  and user_id . The type and length values must be consistent with the values supported by the underlying keyring plugin. See Section 6.4.4.12, “Supported Keyring Key Types and Lengths” . 

Syntax: 

bool my_key_generate(const char *key_id, const char *key_type, const char *user_id, size_t key_len) 

Arguments: 

• key_id , user_id : Null-terminated strings that as a pair form a unique identifier for the key to be generated. 

• key_type : A null-terminated string that provides additional information about the key. 

• key_len : The size in bytes of the key to be generated. 

Return value: 

Returns 0 for success, 1 for failure. 

• my_key_remove() 

Removes a key from the keyring. 

Syntax: 

bool my_key_remove(const char *key_id, const char* user_id) 

Arguments: 

• key_id , user_id : Null-terminated strings that as a pair form a unique identifier for the key to be removed. 

Return value: 

Returns 0 for success, 1 for failure. 

