crypto

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPrivateKey

func NewPrivateKey() (crypto.PrivateKey, error)

Types

type Signer

type Signer interface {
	crypto.Signer
	Certificate() []byte
}

func NewSigner

func NewSigner(cert *x509.Certificate, key interface{}) (Signer, error)

type Suite

type Suite interface {
	// Sign is used for signing message by presented private key
	Sign(msg []byte, key interface{}) ([]byte, error)
	// Verify is used for verifying signature for presented message and public key
	Verify(publicKey interface{}, msg, sig []byte) error
	// Hash is used for hashing presented data
	Hash(data []byte) []byte
	// NewPrivateKey generates new private key
	NewPrivateKey() (interface{}, error)
	// GetSignatureAlgorithm returns signature algorithm
	GetSignatureAlgorithm() x509.SignatureAlgorithm
}

Suite describes common cryptographic operations

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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