aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/auth/dsa2pub.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-02-13 22:10:33 +0000
committerrsc <devnull@localhost>2005-02-13 22:10:33 +0000
commit6acff93f3df9e47a0b4b05804e08d67f478b4e91 (patch)
tree8fb14f22b1e351f6963b34c5126ffa47c8f3c5af /src/cmd/auth/dsa2pub.c
parent9bce1d1eed81595da741991b6cfa33832cf3e4d9 (diff)
downloadplan9port-6acff93f3df9e47a0b4b05804e08d67f478b4e91.tar.gz
plan9port-6acff93f3df9e47a0b4b05804e08d67f478b4e91.tar.bz2
plan9port-6acff93f3df9e47a0b4b05804e08d67f478b4e91.zip
lower case
Diffstat (limited to 'src/cmd/auth/dsa2pub.c')
-rw-r--r--src/cmd/auth/dsa2pub.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/cmd/auth/dsa2pub.c b/src/cmd/auth/dsa2pub.c
new file mode 100644
index 00000000..37dc8328
--- /dev/null
+++ b/src/cmd/auth/dsa2pub.c
@@ -0,0 +1,44 @@
+#include <u.h>
+#include <libc.h>
+#include <auth.h>
+#include <mp.h>
+#include <libsec.h>
+#include "rsa2any.h"
+
+void
+usage(void)
+{
+ fprint(2, "usage: auth/dsa2pub [file]\n");
+ exits("usage");
+}
+
+void
+main(int argc, char **argv)
+{
+ RSApriv *key;
+ Attr *a;
+ char *s;
+
+ fmtinstall('A', _attrfmt);
+ fmtinstall('B', mpfmt);
+ quotefmtinstall();
+
+ ARGBEGIN{
+ default:
+ usage();
+ }ARGEND
+
+ if(argc > 1)
+ usage();
+
+ if((key = getdsakey(argc, argv, 0, &a)) == nil)
+ sysfatal("%r");
+
+ s = smprint("key %A p=%lB q=%lB alpha=%lB key=%lB\n",
+ a,
+ key->pub.p, key->pub.q, key->pub.alpha, key->pub.key);
+ if(s == nil)
+ sysfatal("smprint: %r");
+ write(1, s, strlen(s));
+ exits(nil);
+}