MCPcopy
hub / github.com/gliderlabs/ssh / HostKeyPEM

Function HostKeyPEM

options.go:54–65  ·  view source on GitHub ↗

HostKeyPEM returns a functional option that adds HostSigners to the server from a PEM file as bytes.

(bytes []byte)

Source from the content-addressed store, hash-verified

52// HostKeyPEM returns a functional option that adds HostSigners to the server
53// from a PEM file as bytes.
54func HostKeyPEM(bytes []byte) Option {
55 return func(srv *Server) error {
56 signer, err := gossh.ParsePrivateKey(bytes)
57 if err != nil {
58 return err
59 }
60
61 srv.AddHostKey(signer)
62
63 return nil
64 }
65}
66
67// NoPty returns a functional option that sets PtyCallback to return false,
68// denying PTY requests.

Callers

nothing calls this directly

Calls 1

AddHostKeyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…