msign

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: MIT Imports: 11 Imported by: 1

README

github.com/m-sign/msign

License Actions Status PkgGoDev Go Report Card Coverage Status

Overview

This repository contains Golang's implementation of the m-sign signature.

Usage

See the tools repository as an example of usage.

Contributing

We encourage and support an active, healthy community of contributors — including you! Details are in the contribution guide and the code of conduct.

Contributor Covenant

Documentation

Index

Constants

View Source
const (
	PrefixSIG = "SIG:" // signature prefix
	PrefixPUB = "PUB:" // public key prefix
	PrefixKEY = "KEY:" // private key prefix
)
View Source
const (
	VersionOne = 1 // msign version 1
)

Variables

View Source
var (
	ErrInvalidPubFormat = errors.New("invalid public key format")
	ErrInvalidSigFormat = errors.New("invalid signature format")
	ErrInvalidKeyFormat = errors.New("invalid private key format")
	ErrInvalidSignature = errors.New("invalid signature")
	ErrKeyIdMismatch    = errors.New("invalid signature (key id mismatch)")
	ErrUknownType       = errors.New("unknown export type")
	ErrNilWriter        = errors.New("nil writer")
	ErrNilReader        = errors.New("nil reader")
)

Functions

func Export

func Export(w io.Writer, item any) error

func NewPrivateKey

func NewPrivateKey() (PrivateKey, PublicKey, error)

Types

type KeyId

type KeyId []byte

func (KeyId) String

func (k KeyId) String() string

type PrivateKey

type PrivateKey interface {
	Id() KeyId
	Public() PublicKey
	Sign(io.Reader) (Signature, error)
	// contains filtered or unexported methods
}

func ImportPrivateKey

func ImportPrivateKey(r io.Reader) (PrivateKey, error)

type PublicKey

type PublicKey interface {
	Id() KeyId
	Verify(io.Reader, Signature) (bool, error)
	// contains filtered or unexported methods
}

func ImportPublicKey

func ImportPublicKey(r io.Reader) (PublicKey, error)

type Signature

type Signature interface {
	KeyId() KeyId
	// contains filtered or unexported methods
}

func ImportSignature

func ImportSignature(r io.Reader) (Signature, error)

Jump to

Keyboard shortcuts

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