10 fprint(2, "auth/asn12rsa [-t tag] [file]\n");
15 main(int argc, char **argv)
24 fmtinstall('B', mpfmt);
35 if(argc != 0 && argc != 1)
43 if((fd = open(file, OREAD)) < 0)
44 sysfatal("open %s: %r", file);
48 buf = realloc(buf, tot+8192);
50 sysfatal("realloc: %r");
51 if((n = read(fd, buf+tot, 8192)) < 0)
58 key = asn1toRSApriv(buf, tot);
60 sysfatal("couldn't parse asn1 key");
62 s = smprint("key proto=rsa %s%ssize=%d ek=%lB !dk=%lB n=%lB !p=%lB !q=%lB !kp=%lB !kq=%lB !c2=%lB\n",
63 tag ? tag : "", tag ? " " : "",
64 mpsignif(key->pub.n), key->pub.ek,
65 key->dk, key->pub.n, key->p, key->q,
66 key->kp, key->kq, key->c2);
68 sysfatal("smprint: %r");
69 write(1, s, strlen(s));