This commit is contained in:
Pablo Ovelleiro Corral 2024-03-27 16:34:28 +01:00
parent c8131295e4
commit 4cc344b2b2
No known key found for this signature in database
GPG key ID: 29E9A6ED72CCB334

View file

@ -70,6 +70,7 @@ func SSHPrivateKeyToAge(bytes []byte) (*string, error) {
func main() { func main() {
// TODO turn these into CLI inputs // TODO turn these into CLI inputs
// keyfile := "/home/pinpox/gnutmp/0xA5BCEFD22D30118A.priv.asc"
keyfile := "./test-key.asc" keyfile := "./test-key.asc"
e, err := readEntity(keyfile) e, err := readEntity(keyfile)
@ -143,9 +144,9 @@ func main() {
log.Println("public SSH key:", string(ssh.MarshalAuthorizedKey(sshPub))) log.Println("public SSH key:", string(ssh.MarshalAuthorizedKey(sshPub)))
// TODO: are these the correct bytes? // TODO: are these the correct bytes?
var privkey ed25519.PrivateKey = castkey.D // var privkey ed25519.PrivateKey = castkey.D
// var privkey ed25519.PrivateKey = castkey.MarshalByteSecret() // var privkey ed25519.PrivateKey = castkey.MarshalByteSecret()
// var privkey = ed25519.NewKeyFromSeed(castkey.D) var privkey = ed25519.NewKeyFromSeed(castkey.D)
// TODO is this right? // TODO is this right?
bytes, err := ed25519PrivateKeyToCurve25519(privkey) bytes, err := ed25519PrivateKeyToCurve25519(privkey)
@ -153,6 +154,8 @@ func main() {
log.Fatal(err) log.Fatal(err)
} }
// bytes = privkee
// TODO trying to get private key as age key // TODO trying to get private key as age key
agekey, err := SSHPrivateKeyToAge(bytes) agekey, err := SSHPrivateKeyToAge(bytes)
if err != nil { if err != nil {