MCPcopy Index your code
hub / github.com/ContainerSSH/ContainerSSH / SSHKeyAlgoListFromStringList

Function SSHKeyAlgoListFromStringList

config/ssh.go:235–242  ·  view source on GitHub ↗

SSHKeyAlgoListFromStringList converts a string list into a list of SSH key algorithms.

(hostKeyAlgorithms []string)

Source from the content-addressed store, hash-verified

233
234// SSHKeyAlgoListFromStringList converts a string list into a list of SSH key algorithms.
235func SSHKeyAlgoListFromStringList(hostKeyAlgorithms []string) (SSHKeyAlgoList, error) {
236 result := make([]SSHKeyAlgo, len(hostKeyAlgorithms))
237 for i, algo := range hostKeyAlgorithms {
238 result[i] = SSHKeyAlgo(algo)
239 }
240 r := SSHKeyAlgoList(result)
241 return result, r.Validate()
242}
243
244// MustSSHKeyAlgoListFromStringList is identical to SSHKeyAlgoListFromStringList but panics on
245// error.

Callers 2

TestConformanceFunction · 0.92

Calls 3

SSHKeyAlgoTypeAlias · 0.85
SSHKeyAlgoListTypeAlias · 0.85
ValidateMethod · 0.65

Tested by 1

TestConformanceFunction · 0.74