crypto

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EcdsaSha256Signer

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

EcdsaSha256Signer is the signer implementation of ECDSA-SHA256.

func NewEcdsaSha256Signer

func NewEcdsaSha256Signer(key []byte) (s EcdsaSha256Signer, err error)

NewEcdsaSha256Signer parses given key and creates EcdsaSha256Signer.

func (EcdsaSha256Signer) Sign

func (s EcdsaSha256Signer) Sign(message []byte) (signed []byte, err error)

Sign signs given message.

type EcdsaSha256Verifier

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

EcdsaSha256Verifier is the verifier implementation of ECDSA-SHA256.

func NewEcdsaSha256Verifier

func NewEcdsaSha256Verifier(certificate []byte) (v EcdsaSha256Verifier, err error)

NewEcdsaSha256Verifier parses given certificate and creates EcdsaSha256Verifier.

func (EcdsaSha256Verifier) Verify

func (v EcdsaSha256Verifier) Verify(message []byte, signature []byte) bool

Verify verifies if given message and given signature are matched.

type Signer

type Signer interface {
	Sign(message []byte) (signature []byte, err error)
}

Signer defines an interface to sign messages.

type Verifier

type Verifier interface {
	Verify(message []byte, signature []byte) (verified bool)
}

Verifier defines an interface to verify if the message and the signature are matched.

Jump to

Keyboard shortcuts

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