initial stub commit

This commit is contained in:
Barak Michener 2020-09-23 14:59:50 -07:00
parent 0d98c203f0
commit 07036afafa
5 changed files with 61 additions and 0 deletions

24
config.go Normal file
View file

@ -0,0 +1,24 @@
package ussher
import (
"io/ioutil"
"golang.org/x/crypto/ssh"
)
type Config struct {
HostKeyPath string
Keystore Keystore
}
func (c *Config) GetPrivateKey() (ssh.Signer, error) {
bytes, err := ioutil.ReadFile(c.HostKeyPath)
if err != nil {
return nil, err
}
return ssh.ParsePrivateKey(bytes)
}
type Keystore interface {
CheckPublicKey(user string, key ssh.PublicKey) (*ssh.Permissions, error)
}