Documentation ¶
Index ¶
- Variables
- type KeyPair
- func (k KeyPair) AddToAgent() error
- func (k KeyPair) MarshalPrivateKey(passphrase string) ([]byte, error)
- func (k KeyPair) MarshalPublicKey() ([]byte, error)
- func (k KeyPair) Save(path, passphrase string) (err error)
- func (k KeyPair) WritePrivateKey(w io.Writer, passphrase string) error
- func (k KeyPair) WritePublicKey(w io.Writer) error
- type KeyType
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type KeyPair ¶
type KeyPair struct { Public crypto.PublicKey Private crypto.PrivateKey Type KeyType Comment string }
func NewEd25519KeyPair ¶
func NewRSAKeyPair ¶
func (KeyPair) AddToAgent ¶
func (KeyPair) MarshalPrivateKey ¶
func (KeyPair) MarshalPublicKey ¶
func (KeyPair) WritePrivateKey ¶
func (KeyPair) WritePublicKey ¶
WritePublicKey marshals the public key to the OpenSSH format.
Adapted from https://cs.opensource.google/go/x/crypto/+/master:ssh/keys.go;l=279-290;drc=b4de73f9ece8163b492578e101e4ef8923ac2c5c. (Adds comment support and uses io.Writer directly.)
Click to show internal directories.
Click to hide internal directories.