Skip to content

Commit

Permalink
describe data interface
Browse files Browse the repository at this point in the history
  • Loading branch information
robdefeo committed Aug 27, 2019
1 parent e81809d commit 200aad1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/envelope/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ const (
)

type Data interface {
// URL returns the addressable location of the message, the URL may be encrypted requiring decrypter to be supplied.
URL(decrypter cipher.Decrypter) (*url.URL, error)
// IntegrityHash returns a hash of the encrypted content. This can be used to validate the integrity of the contents before decrypting.
IntegrityHash(decrypter cipher.Decrypter) ([]byte, error)
// ContentsHash returns a hash of the decrypted content. This can be used to verify the contents of the message have not been tampered with.
ContentsHash(decrypter cipher.Decrypter) ([]byte, error)
// Valid will verify the contents of the envelope.
Valid() error
}

0 comments on commit 200aad1

Please sign in to comment.