signature

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeWindow = 5 * time.Minute
)

Variables

This section is empty.

Functions

func LoadPrivateKeyFromString

func LoadPrivateKeyFromString(key string) (*rsa.PrivateKey, error)

func LoadRSAPublicKey

func LoadRSAPublicKey(key string) (*rsa.PublicKey, error)

func Sign

func Sign(message Message, privateKey *rsa.PrivateKey) ([]byte, error)

func Verify

func Verify(signature []byte, message Message, publicKey *rsa.PublicKey) (bool, error)

Types

type Message

type Message interface {
	Prepare() []byte
	GetTimeStamp() (*time.Time, error)
	SetTimeStamp()
}

Jump to

Keyboard shortcuts

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