2 * photoid.c - Routines for OpenPGP id photos.
4 * Jonathan McDowell <noodles@earth.li>
6 * Copyright 2004 Project Purple
8 * $Id: photoid.c,v 1.1 2004/05/27 01:25:37 noodles Exp $
19 #include "keystructs.h"
22 * getphoto - returns an OpenPGP packet containing a photo id.
23 * @key: The key to return the photo id from.
24 * @index: The index of the photo to return.
26 * This function returns the OpenPGP packet containing a photo id from a
27 * supplied key. index specifies which photo id should be returned. If
28 * there's no such photo id NULL is returned.
30 struct openpgp_packet *getphoto(struct openpgp_publickey *key, int index)
32 struct openpgp_signedpacket_list *curuid = NULL;
33 struct openpgp_packet *photo = NULL;
40 while (photo == NULL && curuid != NULL && i <= index) {
41 if (curuid->packet->tag == 17) {
43 photo = curuid->packet;
48 curuid = curuid->next;