PUBLICKEY(3)
π PUBLICKEY(3) π
okay so bestie, this is the PUBLICKEY(3) manual page from the Library Functions Manual β and it's literally all about getting keys, like, the keys. buckle up π
β¨ NAME β¨
publickey, getpublickey, getsecretkey β get public or secret key ποΈβ¨
π LIBRARY π
RPC Service Library β that's librpcsvc, and you link it with -lrpcsvc. no cap. π«Ά
π©· SYNOPSIS π©·
okay so first you gotta bring in the headers, like:
#include <rpc/rpc.h>
#include <rpc/key_prot.h>
then the functions themselves, in all their iconic glory:
int
getpublickey(const char netname[MAXNETNAMELEN+1],
char publickey[HEXKEYBYTES+1]);
int
getsecretkey(char netname[MAXNETNAMELEN+1],
char secretkey[HEXKEYBYTES+1], char *passwd);
note the sizes bestie β MAXNETNAMELEN+1 for the netname, HEXKEYBYTES+1 for the key. they're literally right there in the brackets, do not come for me π₯
πΈ DESCRIPTION πΈ
okay so these routines are the ones you call to get public and secret keys out of the YP database. that's the whole vibe. π«
getsecretkey() is the one with the extra little bonus argument β passwd β and it's there for a reason: it's what decrypts the encrypted secret key that's stored in the database. so like, the secret key is sitting in there all locked up, and passwd is the key to the key πβ¨ it's giving layers.
both routines return 1 if they were successful in finding the key, and 0 otherwise. simple as that, no cap. π
and the keys themselves come back as NUL-terminated, hexadecimal strings β so like, hex text, with a NUL at the end. iconic formatting tbh. π
β οΈ okay this part is important bestie, pay attention: if the password you supplied togetsecretkey()fails to decrypt the secret key, the routine will still return1β but thesecretkeyargument will be a NUL string (""). so it looks like a success but you got literally nothing back π fr fr, vibe check your password before you trust that return value π
π¦ SEE ALSO π¦
publickey(5)- RPC Programmer's Manual in
/usr/share/doc/psd/23.rpc
and that's the whole page, bestie β mwah π
this lil slice of Debian history is dated October 6, 1987 and comes to you from the Debian crew. old but still slaying π«Άβ¨π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms