(public string)
| 121 | } |
| 122 | |
| 123 | func (m *MemKeyPairStorage) GetKeyFromPublic(public string) (*KeyPair, error) { |
| 124 | v, err := m.public.Get(public) |
| 125 | if err != nil { |
| 126 | return nil, err |
| 127 | } |
| 128 | |
| 129 | keyPair, ok := v.(*KeyPair) |
| 130 | if !ok { |
| 131 | return nil, fmt.Errorf("MemKeyPairStorage: GetKeyFromPublic value is malformed %+v", v) |
| 132 | } |
| 133 | |
| 134 | return keyPair, nil |
| 135 | } |
| 136 | |
| 137 | func (m *MemKeyPairStorage) IsValid(public string) error { |
| 138 | _, err := m.GetKeyFromPublic(public) |