HostKeyPEM returns a functional option that adds HostSigners to the server from a PEM file as bytes.
(bytes []byte)
| 52 | // HostKeyPEM returns a functional option that adds HostSigners to the server |
| 53 | // from a PEM file as bytes. |
| 54 | func 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. |
nothing calls this directly
no test coverage detected
searching dependent graphs…