ident

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package ident provides the functions required by kwild for message and transaction signature verification, and address derivation. Out of the box it supports verification with signatures created by one of the required default signers in core/crypto/auth.

It also contains the Authenticator registry used by these methods. The registry is populated by: (1) automatically registering the default Authenticators, and (2) importing any auth extensions at or near the level of package main.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAuthenticatorExists is returned when an authenticator is already registered
	ErrAuthenticatorExists = errors.New("authenticator already exists")
	// ErrAuthenticatorNotFound is returned when an authenticator is not found
	ErrAuthenticatorNotFound = errors.New("authenticator not found")
)

Functions

func Identifier

func Identifier(authType string, sender []byte) (string, error)

Identifier returns a string identifier from a sender and authenticator type. The function requires an Authenticator to be registered for the signature type.

func VerifySignature

func VerifySignature(identity []byte, msg []byte, sig *auth.Signature) error

VerifySignature verifies the signature given a signer's identity and the message. It uses the Authenticator registry in this package.

func VerifyTransaction

func VerifyTransaction(tx *transactions.Transaction) error

VerifyTransaction verifies a transaction's signature using the Authenticator registry in this package.

Types

type User

type User struct {
	// PublicKey is the public key of the user
	PublicKey []byte

	// AuthType is the type of authentication used by the user
	AuthType string
}

User is an end user of the engine, identified by a public key. It includes an authentication type, which is used to determine how to authenticate the and how to generate an address for the user.

func (*User) MarshalBinary

func (u *User) MarshalBinary() ([]byte, error)

func (*User) UnmarshalBinary

func (u *User) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

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