verification

package
v0.0.0-...-de2cd80 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ImplicitMessageIntegrityKey = "IMPLICIT_MESSAGE_INTEGRITY_KEY"
View Source
const SignatureFieldName = "signature"

Variables

This section is empty.

Functions

func SignProto

func SignProto(message VerifiableMessage, key []byte) error

SignProto signs a proto that has a proto field Signature.

func ValidateHMAC

func ValidateHMAC(message VerifiableMessage, key []byte) (bool, error)

Check the signature embedded in the protobuf message is correct for the message by recalculating it using the secret key.

Types

type VerifiableMessage

type VerifiableMessage interface {
	proto.Message
	GetSignature() []byte
}

VerifiableMessage a proto message that has a Signature field. Using the extension interface pattern so that I can read the Signature.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL