ParsePublicKey will return a PublicKey from the given data.
(data []byte)
| 18 | |
| 19 | // ParsePublicKey will return a PublicKey from the given data. |
| 20 | func ParsePublicKey(data []byte) (*PublicKey, error) { |
| 21 | var err error |
| 22 | |
| 23 | var pk PublicKey |
| 24 | |
| 25 | pk.PublicKey, pk.Comment, _, _, err = ssh.ParseAuthorizedKey(data) |
| 26 | if err != nil { |
| 27 | return nil, err |
| 28 | } |
| 29 | |
| 30 | return &pk, nil |
| 31 | } |
| 32 | |
| 33 | // UnmarshalYAML implements yaml.Unmarshaler.UnmarshalYAML. |
| 34 | func (pk *PublicKey) UnmarshalYAML(unmarshal func(v interface{}) error) error { |
no outgoing calls