1 # $OpenBSD: keygen-convert.sh,v 1.1 2009/11/09 04:20:04 dtucker Exp $
2 # Placed in the Public Domain.
7 # generate user key for agent
8 trace
"generating $t key"
10 ${SSHKEYGEN} -q -N "" -t $t -f $OBJ/$t-key
12 trace
"export $t private to rfc4716 public"
13 ${SSHKEYGEN} -q -e -f $OBJ/$t-key >$OBJ/$t-key-rfc || \
14 fail
"export $t private to rfc4716 public"
16 trace
"export $t public to rfc4716 public"
17 ${SSHKEYGEN} -q -e -f $OBJ/$t-key.pub
>$OBJ/$t-key-rfc.pub || \
18 fail
"$t public to rfc4716 public"
20 cmp $OBJ/$t-key-rfc $OBJ/$t-key-rfc.pub || \
21 fail
"$t rfc4716 exports differ between public and private"
23 trace
"import $t rfc4716 public"
24 ${SSHKEYGEN} -q -i -f $OBJ/$t-key-rfc >$OBJ/$t-rfc-imported || \
25 fail
"$t import rfc4716 public"
27 cut
-f1,2 -d " " $OBJ/$t-key.pub
>$OBJ/$t-key-nocomment.pub
28 cmp $OBJ/$t-key-nocomment.pub
$OBJ/$t-rfc-imported || \
29 fail
"$t imported differs from original"
31 rm -f $OBJ/$t-key $OBJ/$t-key.pub
$OBJ/$t-key-rfc $OBJ/$t-key-rfc.pub \
32 $OBJ/$t-rfc-imported $OBJ/$t-key-nocomment.pub