15 fprint(2, "usage: aux/x5092pub [-r] [file]\n");
20 main(int argc, char **argv)
27 fmtinstall('B', mpfmt);
28 fmtinstall('H', encodefmt);
40 fd = open(argv[0], OREAD);
46 buf = realloc(buf, tot+8192);
48 sysfatal("realloc: %r");
49 if((n = read(fd, buf+tot, 8192)) < 0)
56 pub = X509reqtoRSApub(buf, tot, subject, sizeof(subject));
58 pub = X509toRSApub(buf, tot, subject, sizeof(subject));
60 sysfatal("X509toRSApub: %r");
61 print("key proto=rsa size=%d ek=%B n=%B subject=%q \n", mpsignif(pub->n), pub->ek, pub->n, subject);