transit

package
v0.0.0-...-e984f34 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	KeyType string
	Handle  *keyset.Handle
	Version int
}

func NewHandler

func NewHandler(handle *keyset.Handle, keyType string, version int) (*Handler, error)

func (*Handler) ComputeHMAC

func (h *Handler) ComputeHMAC(message []byte) ([]byte, error)

func (*Handler) Decrypt

func (h *Handler) Decrypt(cipherText []byte, associatedData []byte) ([]byte, error)

func (*Handler) Encrypt

func (h *Handler) Encrypt(plainText []byte, associatedData []byte) ([]byte, error)

func (*Handler) GenerateKeyTemplate

func (h *Handler) GenerateKeyTemplate() (*tinkpb.KeyTemplate, error)

func (*Handler) Sign

func (h *Handler) Sign(message []byte) ([]byte, error)

func (*Handler) Verify

func (h *Handler) Verify(message []byte, signatureValue []byte) error

func (*Handler) VerifyHMAC

func (h *Handler) VerifyHMAC(message []byte, hmacValue []byte) error

type Transit

type Transit interface {
	GenerateKeyTemplate() (*tinkpb.KeyTemplate, error)

	Encrypt(plainText []byte, associatedData []byte) ([]byte, error)
	Decrypt(cipherText []byte, associatedData []byte) ([]byte, error)

	ComputeHMAC(message []byte) ([]byte, error)
	VerifyHMAC(message []byte, hmacValue []byte) error

	Sign(message []byte) ([]byte, error)
	Verify(message []byte, signatureValue []byte) error
}

Jump to

Keyboard shortcuts

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