Documentation ¶
Overview ¶
sshcrypt provides some helper functions to use / parse ssh keys in order to use them for encryption.
A lot of this is just exposing stuff in crypto/ssh.
Index ¶
- func MarshalAuthorizedKey(key ssh.PublicKey) []byte
- type PrivateKey
- type PublicKey
- type RSAPrivateKey
- type RSAPublicKey
- func (r *RSAPublicKey) EncryptBytes(in []byte) ([]byte, error)
- func (r *RSAPublicKey) GetCryptoPublicKey() *rsa.PublicKey
- func (r *RSAPublicKey) GetSshPublicKey() *ssh.PublicKey
- func (r *RSAPublicKey) Marshal() []byte
- func (r *RSAPublicKey) Type() string
- func (r *RSAPublicKey) Verify(data []byte, sig *ssh.Signature) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalAuthorizedKey ¶
MarshalAuthorizedKey serializes key for inclusion in an OpenSSH authorized_keys file. The return value ends with newline.
Types ¶
type PrivateKey ¶
func ParsePrivateKey ¶
func ParsePrivateKey(pemBytes []byte, passphrase string) (PrivateKey, error)
// ParsPrivateKey returns a private key from a PEM encoded private key. It // supports RSA (PKCS#1), DSA (OpenSSL), and ECDSA private keys.
type PublicKey ¶
func ParseAuthorizedKey ¶
func ParseAuthorizedKey(in []byte) (out PublicKey, comment string, options []string, rest []byte, err error)
ParseAuthorizedKeys parses a public key from an authorized_keys file used in OpenSSH according to the sshd(8) manual page.
func ParsePublicKey ¶
ParsePublicKey parses an SSH public key formatted for use in the SSH wire protocol according to RFC 4253, section 6.6.
type RSAPrivateKey ¶
type RSAPrivateKey rsa.PrivateKey
func (*RSAPrivateKey) DecryptBytes ¶
func (r *RSAPrivateKey) DecryptBytes(ciphertext []byte) ([]byte, error)
func (*RSAPrivateKey) Type ¶
func (r *RSAPrivateKey) Type() string
type RSAPublicKey ¶
func (*RSAPublicKey) EncryptBytes ¶
func (r *RSAPublicKey) EncryptBytes(in []byte) ([]byte, error)
func (*RSAPublicKey) GetCryptoPublicKey ¶
func (r *RSAPublicKey) GetCryptoPublicKey() *rsa.PublicKey
func (*RSAPublicKey) GetSshPublicKey ¶
func (r *RSAPublicKey) GetSshPublicKey() *ssh.PublicKey
func (*RSAPublicKey) Marshal ¶
func (r *RSAPublicKey) Marshal() []byte
func (*RSAPublicKey) Type ¶
func (r *RSAPublicKey) Type() string