signing

package
v1.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ECDSA

type ECDSA struct {
	SignatureAlgorithm
	Private *ecdsa.PrivateKey
	Public  *ecdsa.PublicKey
}

func NewECDSA

func NewECDSA(privateKey *ecdsa.PrivateKey, publicKey *ecdsa.PublicKey) *ECDSA

func (*ECDSA) Sign

func (a *ECDSA) Sign(msg []byte) ([]byte, error)

func (*ECDSA) Verify

func (a *ECDSA) Verify(msg []byte, signature []byte) (bool, error)

type Ed25519

type Ed25519 struct {
	SignatureAlgorithm
	Private *ed25519.PrivateKey
	Public  *ed25519.PublicKey
}

func NewEd25519

func NewEd25519(privateKey *ed25519.PrivateKey, publicKey *ed25519.PublicKey) *Ed25519

func (*Ed25519) Sign

func (a *Ed25519) Sign(msg []byte) ([]byte, error)

func (*Ed25519) Verify

func (a *Ed25519) Verify(msg []byte, signature []byte) (bool, error)

type SignatureAlgorithm

type SignatureAlgorithm interface {
	Sign(msg []byte) ([]byte, error)
	Verify(msg []byte, signature []byte) (bool, error)
}

Jump to

Keyboard shortcuts

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