signer

package
v0.0.0-...-3a733ff Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PRIVATE_KEY = "" /* 164-byte string literal not displayed */
	PUBLIC_KEY  = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuebCi0tHwx1yDsJ1UbcjfpTkb+4e8oyIP7VqvMdswY3MWcHiWhCZzXAkET78a+dUIIy4W1qEcsN26RRRKcSt8w=="
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EcdsaNIST256pSigCipher

type EcdsaNIST256pSigCipher struct{}

EcdsaNIST256pSigCipher implements the SignatureCipher interface with signature scheme EcdsaNIST256p

type EcdsaSigCipher

type EcdsaSigCipher EcdsaNIST256pSigCipher

EcdsaSigCipher is alias to EcdsaNIST256pSigCipher

func (*EcdsaSigCipher) Sign

func (c *EcdsaSigCipher) Sign(md []byte, privKey interface{}) ([]byte, error)

Sign returns an ECDSA signature that is encoded as ASN.1 der format

func (*EcdsaSigCipher) Verify

func (c *EcdsaSigCipher) Verify(md, sig []byte, pubKey interface{}) bool

Verify verifies a ECDSA signature that is encoded as ASN.1 der format

type SignatureCipher

type SignatureCipher interface {
	// Sign creates signature over the message digest
	Sign(md []byte, privKey interface{}) ([]byte, error)
	// Verify verifies the signature over the message digest
	Verify(md, sig []byte, pubKey interface{}) bool
}

SignatureCipher defines the interface of signature operations used by public cryptographic ciphers

type Signer

type Signer struct {
	HashScheme crypto.Hash
	SigCipher  SignatureCipher
	// contains filtered or unexported fields
}

func NewSigner

func NewSigner() *Signer

func (*Signer) Sign

func (s *Signer) Sign(msg []byte) ([]byte, error)

func (*Signer) Verify

func (s *Signer) Verify(msg, sig []byte) error

Jump to

Keyboard shortcuts

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