mirror of
https://github.com/pinpox/pgp2ssh.git
synced 2025-02-05 10:59:19 +01:00
fix
This commit is contained in:
parent
c8131295e4
commit
4cc344b2b2
7
main.go
7
main.go
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue