|
|
1.1.1.6 ! root 1: /* keymgmt.h - headers for keymgmt.c ! 2: */ ! 3: ! 4: /* Return printable public key fragment. */ ! 5: char *keyIDstring(byte *keyID); ! 6: char *key2IDstring(unitptr n); ! 7: extern char const blankkeyID[]; ! 8: ! 9: /* Do an RSA key pair generation, and write them out to the keyring files. */ ! 10: int dokeygen(char *numstr, char *numstr2); ! 11: ! 12: /* Edit the userid and/or pass phrase for an RSA key pair, and put them back ! 13: into the ring files */ ! 14: int dokeyedit(char *mcguffin, char *ringfile); ! 15: ! 16: /* Copy the first entry in key ring that has mcguffin string in userid and ! 17: put it into keyfile */ ! 18: int extract_from_keyring (char *mcguffin, char *keyfile, char *ringfile, ! 19: boolean transflag); ! 20: ! 21: /* Lists all entries in keyring that have mcguffin string in userid */ ! 22: int view_keyring(char *mcguffin, char *ringfile, boolean show_signatures, boolean show_hashes); ! 23: ! 24: /* Signature-check all entries in keyring that have mcguffin string in userid */ ! 25: int dokeycheck(char *mcguffin, char *ringfile, int options); ! 26: /* options: */ ! 27: #define CHECK_ALL 0 /* Check all signatures */ ! 28: #define CHECK_NEW 1 /* Only check new signatures */ ! 29: ! 30: /* Allow user to remove signatures from keys in keyring that have mcguffin */ ! 31: int remove_sigs(char *mcguffin, char *ringfile); ! 32: ! 33: /* Remove the first entry in key ring that has mcguffin string in userid */ ! 34: int remove_from_keyring(byte *keyID, char *mcguffin, char *ringfile, boolean secring_too); ! 35: ! 36: /* Extract key fragment from modulus n */ ! 37: void extract_keyID(byteptr keyID, unitptr n); ! 38: ! 39: /* Write message prefix keyID to a file */ ! 40: void writekeyID(unitptr n, FILE *f); ! 41: ! 42: /* Extract public key corresponding to keyID or userid from keyfile */ ! 43: int getpublickey(int flags, char *keyfile, ! 44: long *file_position, int *pktlen, byte *keyID, ! 45: byte *timestamp, byte *userid, unitptr n, unitptr e); ! 46: /* flags: */ ! 47: #define GPK_GIVEUP 1 ! 48: #define GPK_SHOW 2 ! 49: #define GPK_NORVK 4 ! 50: #define GPK_DISABLED 8 ! 51: /* Flag used in getsecretkey() only - should it be GSK_? */ ! 52: /* Prevents use of existing password list. */ ! 53: #define GPK_ASKPASS 16 ! 54: #define GPK_SECRET 32 /* We are actually getting a secret key */ ! 55: ! 56: /* Extract private key corresponding to keyID or userid from keyfile */ ! 57: int getsecretkey(int flags, char *keyfile, byte *keyID, byte *timestamp, ! 58: byte *hpass, boolean *hkey, byte *userid, ! 59: unitptr n, unitptr e, unitptr d, unitptr p, unitptr q, ! 60: unitptr u); ! 61: ! 62: /* Return true if ctb is one for a key in a keyring */ ! 63: int is_key_ctb (byte ctb); ! 64: ! 65: /* Read next key packet from file f, return its ctb in *pctb, and advance ! 66: * the file pointer to point beyond the key packet. ! 67: */ ! 68: short nextkeypacket(FILE *f, byte *pctb); ! 69: ! 70: /* Read the next key packet from file f, return info about it in the various ! 71: * pointers. Most pointers can be NULL without breaking it. ! 72: */ ! 73: struct IdeaCfbContext; ! 74: short readkeypacket(FILE *f, struct IdeaCfbContext *cfb, byte *pctb, ! 75: byte *timestamp, char *userid, ! 76: unitptr n ,unitptr e, unitptr d, unitptr p, unitptr q, unitptr u, ! 77: byte *sigkeyID, byte *keyctrl); ! 78: ! 79: /* Starting at key_position in keyfile, scan for the userid packet which ! 80: * matches C string userid. Return the packet position and size. ! 81: */ ! 82: int getpubuserid(char *keyfile, long key_position, byte *userid, ! 83: long *userid_position, int *userid_len, boolean exact_match); ! 84: ! 85: int getpubusersig(char *keyfile, long user_position, byte *sigkeyID, ! 86: byte *timestamp, long *sig_position, int *sig_len); ! 87: ! 88: void getKeyHash( byte *hash, unitptr n, unitptr e ); ! 89: void printKeyHash( byteptr hash, boolean indent ); ! 90: ! 91: extern int is_compromised(FILE *f); ! 92: ! 93: int disable_key(char *, char *);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.