Documentation ¶
Index ¶
Constants ¶
View Source
const (
SignatureSize = sha256.Size
)
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
func Parse(r io.ReadSeeker, w io.Writer) (sig [SignatureSize]byte, bytesWritten int64, err error)
Parse is shorthand for ParseWithToken(nil, r, w).
func ParseWithToken ¶
func ParseWithToken(token []byte, r io.ReadSeeker, w io.Writer) (sig [SignatureSize]byte, bytesWritten int64, err error)
ParseWithToken parses the r input and verifies it starts with the token then writes the data to w and verifies the signature. returns the sha256 signature of the whole message, number of actual data bytes (excluding token and signature) or an err.
Types ¶
type HashWriter ¶
type HashWriter struct {
// contains filtered or unexported fields
}
func New ¶
func New(w io.Writer) *HashWriter
func NewWithToken ¶
func NewWithToken(w io.Writer, token []byte) (*HashWriter, error)
func (*HashWriter) Sign ¶
func (hw *HashWriter) Sign() (sig [SignatureSize]byte, err error)
func (*HashWriter) Size ¶
func (hw *HashWriter) Size() int64
Click to show internal directories.
Click to hide internal directories.