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