identity

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLowS

func IsLowS(k *ecdsa.PublicKey, s *big.Int) (bool, error)

func ToLowS

func ToLowS(k *ecdsa.PublicKey, s *big.Int) (*big.Int, bool, error)

Types

type CryptoImpl

type CryptoImpl struct {
	Creator  []byte
	PrivKey  *ecdsa.PrivateKey
	SignCert *x509.Certificate
}

func (CryptoImpl) Serialize

func (s CryptoImpl) Serialize() ([]byte, error)

func (CryptoImpl) Sign

func (s CryptoImpl) Sign(msg []byte) ([]byte, error)

type ECDSASignature

type ECDSASignature struct {
	R, S *big.Int
}

type Serializer

type Serializer interface {
	Serialize() ([]byte, error)
}

Serializer is an interface which wraps the Serialize function.

Serialize converts an identity to bytes. It returns an error on failure.

type Signer

type Signer interface {
	Sign(message []byte) ([]byte, error)
}

Signer is an interface which wraps the Sign method.

Sign signs message bytes and returns the signature or an error on failure.

type SignerSerializer

type SignerSerializer interface {
	Signer
	Serializer
}

SignerSerializer groups the Sign and Serialize methods.

Jump to

Keyboard shortcuts

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