MCPcopy Create free account
hub / github.com/belak/gitdir / ParsePublicKey

Function ParsePublicKey

models/public_key.go:20–31  ·  view source on GitHub ↗

ParsePublicKey will return a PublicKey from the given data.

(data []byte)

Source from the content-addressed store, hash-verified

18
19// ParsePublicKey will return a PublicKey from the given data.
20func 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.
34func (pk *PublicKey) UnmarshalYAML(unmarshal func(v interface{}) error) error {

Callers 4

TestLookupUserFromKeyFunction · 0.92
mustParsePKFunction · 0.92
cmdHookFunction · 0.92
NewEnvConfigFunction · 0.92

Calls

no outgoing calls

Tested by 2

TestLookupUserFromKeyFunction · 0.74
mustParsePKFunction · 0.74