urbit/base/app/pope/core.hook

48 lines
1.2 KiB
Plaintext
Raw Normal View History

2015-01-13 03:54:27 +03:00
:: Pope, generate key for carrier
::
:::: /hook/core/pope/app
::
/+ sh-utils
!:
::::
::
|%
++ gilt $%([%tang (list tank)] [%prompt @t prom @t])
++ sign
$% [%t %wake ~]
[%g $%([%nice ~] [%rush %txt p=cord])]
==
--
!:
::::
::
=+ cryp=bruw :: XX change to ec2 ++brew eventually
|_ [hide who=@p fra=@t]
++ peer ,_`.
++ poke--args
|= [@ @ who=ship ~]
?> ?=(%czar (clan who))
=. ^who who
=- %.(+<.$ (add-nice (gate-bang ,_noe (return git))))
:- noe=[%g %show our^+.imp our /in/[-.imp]] :: request input
git=prompt/['passphrase: ' %pass '']
::
++ return |=(a=gilt (add-output +> rush/a ,_`+>))
++ pour
|= [@ * sih=*]
=+ sih=;;(sign sih)
?- -.sih
%g ?. ?=(%rush +<.sih) `+>.$
=. fra p.sih
=- %.(+<.$ (gate-bang ,_noe (return tang/~[leaf/msg])))
:- noe=[%t %wait (add ~s1 lat)] :: set print timeout
msg="generating carrier {(scow %p who)} (#{(scow %ud who)})"
2015-01-14 00:03:47 +03:00
::
2015-01-13 03:54:27 +03:00
%t =- %.(+<.$ (add-exit (return tang/-)))
=+ bur=(shax (add who (shax fra)))
=+ arc=(cryp 2.048 bur)
:~ leaf/"generator: {(scow %uw bur)}"
leaf/"fingerprint: {(scow %uw fig:ex:arc)}"
== ==
--