Documentation ¶
Index ¶
- type Key
- func (k Key) Clone() *Key
- func (k *Key) Encrypt(random io.Reader, password []byte) error
- func (k *Key) Load(b []byte) error
- func (k *Key) LoadFromFile(path string) error
- func (k *Key) LoadSSH1(b []byte) error
- func (k *Key) LoadSSH1WithPassword(b []byte, password string) error
- func (k *Key) Marshal() (ret []byte, err error)
- func (k *Key) MarshalSSH1() ([]byte, error)
- func (k *Key) MarshalSSH1WithPassword(password string) ([]byte, error)
- func (k *Key) ParseRawPrivateKey(password []byte) (ret interface{}, err error)
- func (k *Key) ParseRawPublicKey() (interface{}, error)
- func (k *Key) SetKey(key interface{}) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key struct { Version int Algo string PublicKey []byte PrivateKey []byte KeyDerivation string Argon2Memory uint32 Argon2Passes uint32 Argon2Parallelism uint8 Argon2Salt []byte Comment string Encryption string PrivateMac []byte // contains filtered or unexported fields }
func NewFromFile ¶
NewFromFile creates new PuTTY structure from file
func (*Key) LoadFromFile ¶
LoadFromFile reads PuTTY key and loads its contents into the struct
func (*Key) LoadSSH1WithPassword ¶
func (*Key) MarshalSSH1 ¶
func (*Key) MarshalSSH1WithPassword ¶
func (*Key) ParseRawPrivateKey ¶
ParseRawPrivateKey returns a private key from a PuTTY encoded private key. It supports RSA (PKCS#1), DSA (OpenSSL), ECDSA and ED25519 private keys.
func (*Key) ParseRawPublicKey ¶
ParseRawPublicKey returns a public key from a PuTTY encoded private key. It supports the same key types as ParseRawPrivateKey, and will work even if the private part is encrypted
Source Files ¶
Click to show internal directories.
Click to hide internal directories.