UnmarshalYAML implements the yaml.Unmarshaler interface.
(unmarshal func(interface{}) error)
| 89 | |
| 90 | // UnmarshalYAML implements the yaml.Unmarshaler interface. |
| 91 | func (k *PublicKey) UnmarshalYAML(unmarshal func(interface{}) error) error { |
| 92 | var str string |
| 93 | if err := unmarshal(&str); err != nil { |
| 94 | return err |
| 95 | } |
| 96 | |
| 97 | // load public key string |
| 98 | pubKeyBytes, err := hex.DecodeString(str) |
| 99 | if err != nil { |
| 100 | return err |
| 101 | } |
| 102 | |
| 103 | err = k.UnmarshalBinary(pubKeyBytes) |
| 104 | |
| 105 | return err |
| 106 | } |
| 107 | |
| 108 | // IsEqual return true if two keys are equal. |
| 109 | func (k *PublicKey) IsEqual(public *PublicKey) bool { |
nothing calls this directly
no test coverage detected