Verify verifies the signature on a comment.
()
| 169 | |
| 170 | // Verify verifies the signature on a comment. |
| 171 | func (thread *CommentThread) Verify() error { |
| 172 | err := gpg.Verify(&thread.Comment) |
| 173 | if err != nil { |
| 174 | hash, _ := thread.Comment.Hash() |
| 175 | return fmt.Errorf("verification of comment [%s] failed: %s", hash, err) |
| 176 | } |
| 177 | for _, child := range thread.Children { |
| 178 | err = child.Verify() |
| 179 | if err != nil { |
| 180 | return err |
| 181 | } |
| 182 | } |
| 183 | return nil |
| 184 | } |
| 185 | |
| 186 | // mutableThread is an internal-only data structure used to store partially constructed comment threads. |
| 187 | type mutableThread struct { |