SSHKeyAlgoListFromStringList converts a string list into a list of SSH key algorithms.
(hostKeyAlgorithms []string)
| 233 | |
| 234 | // SSHKeyAlgoListFromStringList converts a string list into a list of SSH key algorithms. |
| 235 | func 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. |