2019-08-08 03:36:25 +03:00
|
|
|
:: Create a private key-file for a random (or specified) moon
|
|
|
|
::
|
|
|
|
:::: /hoon/moon/hood/gen
|
|
|
|
::
|
|
|
|
/- *sole
|
|
|
|
/+ *generators
|
|
|
|
::
|
|
|
|
::::
|
|
|
|
::
|
|
|
|
:- %say
|
|
|
|
|= $: [now=@da eny=@uvJ bec=beak]
|
|
|
|
[mon=@p ~]
|
|
|
|
=life
|
|
|
|
public-key=pass
|
|
|
|
==
|
|
|
|
:- %helm-moon
|
2020-12-08 03:47:06 +03:00
|
|
|
^- (unit [=ship =udiff:point:jael])
|
2019-08-08 03:36:25 +03:00
|
|
|
=* our p.bec
|
|
|
|
=/ ran (clan:title our)
|
2020-11-26 17:09:31 +03:00
|
|
|
?: ?=([?(%earl %pawn)] ran)
|
2019-08-08 03:36:25 +03:00
|
|
|
%- %- slog :_ ~
|
2020-11-25 22:39:13 +03:00
|
|
|
leaf+"can't manage a moon from a {?:(?=(%earl ran) "moon" "comet")}"
|
2019-08-08 03:36:25 +03:00
|
|
|
~
|
|
|
|
=/ seg=ship (sein:title our now mon)
|
|
|
|
?. =(our seg)
|
|
|
|
%- %- slog :_ ~
|
|
|
|
:- %leaf
|
|
|
|
"can't create keys for {(scow %p mon)}, which belongs to {(scow %p seg)}"
|
|
|
|
~
|
|
|
|
=/ =^life
|
|
|
|
?. =(*^life life)
|
|
|
|
life
|
|
|
|
+(.^(^life j+/(scot %p our)/life/(scot %da now)/(scot %p mon)))
|
|
|
|
=/ =pass
|
|
|
|
?. =(*pass public-key)
|
|
|
|
public-key
|
2019-08-08 21:22:00 +03:00
|
|
|
=/ cub (pit:nu:crub:crypto 512 (shaz (jam mon life eny)))
|
2020-12-08 03:47:06 +03:00
|
|
|
=/ =seed:jael
|
2020-07-23 11:47:02 +03:00
|
|
|
[mon life sec:ex:cub ~]
|
2019-08-08 03:36:25 +03:00
|
|
|
%- %- slog
|
|
|
|
:~ leaf+"moon: {(scow %p mon)}"
|
|
|
|
leaf+(scow %uw (jam seed))
|
|
|
|
==
|
|
|
|
pub:ex:cub
|
2021-12-08 13:23:35 +03:00
|
|
|
`[mon *id:block:jael %keys [life 1 pass] %.n]
|