UnmarshalBinary does the deserialization.
(keyBytes []byte)
| 146 | |
| 147 | // UnmarshalBinary does the deserialization. |
| 148 | func (s *Signature) UnmarshalBinary(keyBytes []byte) (err error) { |
| 149 | if s == nil { |
| 150 | err = errors.New("nil signature") |
| 151 | return |
| 152 | } |
| 153 | |
| 154 | var sig *Signature |
| 155 | sig, err = ParseSignature(keyBytes) |
| 156 | if err != nil { |
| 157 | return |
| 158 | } |
| 159 | *s = *sig |
| 160 | return |
| 161 | } |
| 162 | |
| 163 | func zeroBytes(bytes []byte) { |
| 164 | for i := range bytes { |