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)
Click to show internal directories.
Click to hide internal directories.