glider-ssh/wrap.go

35 lines
1.2 KiB
Go
Raw Normal View History

2016-10-03 21:54:17 +00:00
package ssh
import gossh "golang.org/x/crypto/ssh"
// PublicKey is an abstraction of different types of public keys.
2016-10-03 21:54:17 +00:00
type PublicKey interface {
gossh.PublicKey
}
// The Permissions type holds fine-grained permissions that are specific to a
// user or a specific authentication method for a user. Permissions, except for
// "source-address", must be enforced in the server application layer, after
// successful authentication. The Permissions are passed on in ServerConn so a
// server implementation can honor them.
2016-10-03 21:54:17 +00:00
type Permissions struct {
*gossh.Permissions
}
// A Signer can create signatures that verify against a public key.
2016-10-03 21:54:17 +00:00
type Signer interface {
gossh.Signer
}
2016-12-20 21:15:39 +00:00
// ParseAuthorizedKey parses a public key from an authorized_keys file used in
// OpenSSH according to the sshd(8) manual page.
2016-10-03 21:54:17 +00:00
func ParseAuthorizedKey(in []byte) (out PublicKey, comment string, options []string, rest []byte, err error) {
return gossh.ParseAuthorizedKey(in)
}
// ParsePublicKey parses an SSH public key formatted for use in
// the SSH wire protocol according to RFC 4253, section 6.6.
2016-10-03 21:54:17 +00:00
func ParsePublicKey(in []byte) (out PublicKey, err error) {
return gossh.ParsePublicKey(in)
}