crypto

package
v0.0.0-...-648c852 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrivKey

type PrivKey interface {
	Sign([]byte) ([]byte, error)
	PubKey() PubKey
	Equals([]byte) bool
	Type() string
}

type PubKey

type PubKey interface {
	VerifySignature([]byte, []byte) bool
	Bytes() []byte
	Equals([]byte) bool
	Type() string
}

type Signature

type Signature struct {
	// Body of the signature.
	Body []byte
	// Signer identity who produced the signature.
	Signer []byte
}

Signature is a tuple containing signature body and reference to signing identity.

type Signer

type Signer interface {
	// ID returns Signer identity like public key
	ID() []byte
	// Sign produces a cryptographic Signature over the given data with internally managed identity.
	Sign([]byte) (Signature, error)
	// Verify performs cryptographic Signature verification of the given data.
	Verify([]byte, Signature) error
}

Signer encapsulates and separates asymmetric cryptographic schema out of Broadcasting protocol logic together with private key management.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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