crypto

package
v0.0.0-...-973239c Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CryptoService

type CryptoService interface {
	Hash(data []byte) []byte
	Sign(privateKey *ecdsa.PrivateKey, data []byte) []byte
	GenerateKeyPair() (*ecdsa.PrivateKey, *ecdsa.PublicKey, error)
	VerifySignature(key []byte, hash []byte, bytes []byte) bool
}

type CryptoServiceImpl

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

func NewCryptoService

func NewCryptoService(logger logging.Logger) *CryptoServiceImpl

func (*CryptoServiceImpl) GenerateKeyPair

func (c *CryptoServiceImpl) GenerateKeyPair() (*ecdsa.PrivateKey, *ecdsa.PublicKey, error)

func (*CryptoServiceImpl) Hash

func (c *CryptoServiceImpl) Hash(data []byte) []byte

func (*CryptoServiceImpl) Sign

func (c *CryptoServiceImpl) Sign(privateKey *ecdsa.PrivateKey, data []byte) []byte

func (*CryptoServiceImpl) VerifySignature

func (c *CryptoServiceImpl) VerifySignature(key []byte, hash []byte, bytes []byte) bool

Jump to

Keyboard shortcuts

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