ussher/config.go

26 lines
436 B
Go

package ussher
import (
"io/ioutil"
"net/http"
"golang.org/x/crypto/ssh"
)
type Config struct {
HostKeyPath string
Keystore Keystore
BindAddress string
Port int
HTTPPort int
SSHApps map[string]SSHApp
HTTPMux *http.ServeMux
}
func (c *Config) GetPrivateKey() (ssh.Signer, error) {
bytes, err := ioutil.ReadFile(c.HostKeyPath)
if err != nil {
return nil, err
}
return ssh.ParsePrivateKey(bytes)
}