signature

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

It implements signature utils using rsa

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSignatureScheme = errors.New("invalid signature scheme")
)

errors

Functions

func CalculateHmac

func CalculateHmac(key, data []byte, algorithm string) (string, error)

calculates HMAC signature based on a key and digest algorithm supported digest algorithms are: SHA1, 256, 512

Types

type Rsa

type Rsa struct {
	// contains filtered or unexported fields
}

func (*Rsa) Sign

func (x *Rsa) Sign(hashed []byte) ([]byte, error)

sign hashed data using private key

func (*Rsa) VerifySignature

func (x *Rsa) VerifySignature(hashed, signature []byte) error

verify hashed data using public key

Jump to

Keyboard shortcuts

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