mirror of
				https://github.com/pinpox/pgp2ssh.git
				synced 2025-11-04 00:39:14 +01:00 
			
		
		
		
	fix
This commit is contained in:
		
							parent
							
								
									c8131295e4
								
							
						
					
					
						commit
						4cc344b2b2
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		
							
								
								
									
										7
									
								
								main.go
									
										
									
									
									
								
							
							
						
						
									
										7
									
								
								main.go
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -70,6 +70,7 @@ func SSHPrivateKeyToAge(bytes []byte) (*string, error) {
 | 
			
		|||
 | 
			
		||||
func main() {
 | 
			
		||||
  // TODO turn these into CLI inputs
 | 
			
		||||
	// keyfile := "/home/pinpox/gnutmp/0xA5BCEFD22D30118A.priv.asc"
 | 
			
		||||
	keyfile := "./test-key.asc"
 | 
			
		||||
 | 
			
		||||
	e, err := readEntity(keyfile)
 | 
			
		||||
| 
						 | 
				
			
			@ -143,9 +144,9 @@ func main() {
 | 
			
		|||
  log.Println("public SSH key:", string(ssh.MarshalAuthorizedKey(sshPub)))
 | 
			
		||||
 | 
			
		||||
	// 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.NewKeyFromSeed(castkey.D)
 | 
			
		||||
  var privkey = ed25519.NewKeyFromSeed(castkey.D)
 | 
			
		||||
 | 
			
		||||
  // TODO is this right?
 | 
			
		||||
	bytes, err := ed25519PrivateKeyToCurve25519(privkey)
 | 
			
		||||
| 
						 | 
				
			
			@ -153,6 +154,8 @@ func main() {
 | 
			
		|||
		log.Fatal(err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// bytes = privkee
 | 
			
		||||
 | 
			
		||||
  // TODO trying to get private key as age key
 | 
			
		||||
	agekey, err := SSHPrivateKeyToAge(bytes)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue