license

package module
v0.0.0-...-f739353 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PrivateKey ed25519.PrivateKey

PrivateKey is the global var for setting the private key

View Source
var PublicKey ed25519.PublicKey

PublicKey is the global var for setting the public key

Functions

func Verify

func Verify(msg []byte) (data []byte, err error)

Verify verifies the signed response using the global public key variable

Types

type SignedResponse

type SignedResponse struct {
	Data      json.RawMessage `json:"data"`
	CreatedAt time.Time       `json:"created_at"`
	Signature []byte          `json:"signature"`
}

func Sign

func Sign(data interface{}) (sr *SignedResponse, err error)

Sign creates the signed response using the global private key variable

func (*SignedResponse) Sign

func (r *SignedResponse) Sign(priv ed25519.PrivateKey)

Sign signs the data with timestamp and private key

func (SignedResponse) TimestampedData

func (r SignedResponse) TimestampedData() (d []byte)

TimestampedData combines data and timestamp

func (SignedResponse) Verify

func (r SignedResponse) Verify(pub ed25519.PublicKey) (ok bool)

Verify verifies the data with the timestamp and public key

Jump to

Keyboard shortcuts

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