signature

package
Version: v1.18.6 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MPL-2.0 Imports: 11 Imported by: 2

Documentation

Overview

Package signature provides simple methods to create and verify signatures in PEM format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeys

func GenerateKeys() (privKey []byte, pubKey []byte, err error)

GenerateKeys returns a new key pair, with the private and public key encoded in PEM format.

func Sign

func Sign(privKeyPEM []byte, data io.Reader) ([]byte, error)

Sign computes the hash of data and signs it with the private key, returning a signature in PEM format.

func Verify

func Verify(pubKeyPEM []byte, signature []byte, data io.Reader) error

Verify computes the hash of data and compares it to the signature using the given public key. Returns nil if the signature is correct.

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

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