crypto

package
v0.0.0-...-c36b4a8 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package crypto implements crypto interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RSAPSS

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

RSAPSS represents RSA PSS algo for signing/verification (with SHA256 as digest calculation function).

func NewRSAPSS

func NewRSAPSS(privKey rsa.PrivateKey, pubKey rsa.PublicKey) RSAPSS

NewRSAPSS creates new RSAPSS object.

func (*RSAPSS) Name

func (r *RSAPSS) Name() string

Name implements SignerVerifier interface.

func (*RSAPSS) Sign

func (r *RSAPSS) Sign(data []byte) ([]byte, error)

Sign generates SHA-256 digest and signs it using RSASSA-PSS.

func (*RSAPSS) Verify

func (r *RSAPSS) Verify(data []byte, signature []byte) error

Verify compares data with signature.

type Signer

type Signer interface {
	// Name returns name of the crypto algorithm, used by signer.
	Name() string
	// Sign returns signature for passed data.
	Sign(data []byte) ([]byte, error)
}

Signer implements high-level API for package signing.

type SignerVerifier

type SignerVerifier interface {
	Signer
	Verifier
}

SignerVerifier common interface.

type Verifier

type Verifier interface {
	// Name returns name of the crypto algorithm, used by verifier.
	Name() string
	// Verify checks data and signature mapping.
	Verify(data []byte, signature []byte) error
}

Verifier is an interface implementing a generic signature verification algorithm.

Jump to

Keyboard shortcuts

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