gpg: Add accessor & utility functions for pk->keyid and pk->main_keyid.
* g10/keydb.h (keyid_cmp): New function. * g10/keyid.c (pk_keyid): New function. (pk_main_keyid): New function. (keyid_copy): New function. (pk_keyid_str): New function. * g10/packet.h (PKT_public_key): Update comments for main_keyid and keyid.
Before accessing pk->keyid, it is necessary to call keyid_from_pk (pk,
NULL) to ensure that pk->keyid is valid. Because it is easy to forget
to do this, these accessor functions take care of it.
- Signed-off-by: Neal H. Walfield <neal@g10code.com>