sign

package
v0.0.0-...-ffea4ed Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKeyPair

func CreateKeyPair() (*rsa.PrivateKey, *rsa.PublicKey, error)

CreateKeyPair creates and returns a private key, public key

func ValidSignature

func ValidSignature(h DocumentHash, s Signature, k *rsa.PublicKey) error

ValidSignature checks if the provided public key (k) is valid for the signature (s) of a document's hash (h)

Types

type DocumentHash

type DocumentHash string

DocumentHash represents the hashed value of a document

func HashDocument

func HashDocument(d interface{}) (DocumentHash, error)

HashDocument creates and returns the DocumentHash of the provided document (d)

type Signature

type Signature string

Signature represents a document's signature

func Sign

func Sign(h DocumentHash, k *rsa.PrivateKey) (Signature, error)

Sign creates and returns a Signature based upon a document hash (h) and a private key (k)

Jump to

Keyboard shortcuts

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