sigtest

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSerializedKeyFromCert

func GetSerializedKeyFromCert(certPath string) (signature.PublicKey, error)

GetSerializedKeyFromCert reads a ECDSA public key from a certificate file.

func ParseSigningKey

func ParseSigningKey(keyContent []byte) (*ecdsa.PrivateKey, error)

ParseSigningKey decodes a ECDSA key from a PEM file.

func SerializeSigningKey

func SerializeSigningKey(key *ecdsa.PrivateKey) ([]byte, error)

SerializeSigningKey encodes a ECDSA private key into a PEM file.

func SerializeVerificationKey

func SerializeVerificationKey(key *ecdsa.PublicKey) ([]byte, error)

SerializeVerificationKey encodes a ECDSA public key into a PEM file.

Types

type BlsSigner

type BlsSigner struct {
	// contains filtered or unexported fields
}

BlsSigner signs using the BLS scheme.

func NewBlsSigner

func NewBlsSigner(key signature.PrivateKey) *BlsSigner

NewBlsSigner instantiate a BlsSigner given a key.

func (*BlsSigner) Sign

func (b *BlsSigner) Sign(digest signature.Digest) (signature.Signature, error)

Sign signs a digest.

type DigestSigner

type DigestSigner interface {
	Sign(signature.Digest) (signature.Signature, error)
}

DigestSigner is an interface for signing a digest.

type EcdsaSigner

type EcdsaSigner struct {
	// contains filtered or unexported fields
}

EcdsaSigner signs using the ECDSA scheme.

func NewEcdsaSigner

func NewEcdsaSigner(key signature.PrivateKey) (*EcdsaSigner, error)

NewEcdsaSigner instantiate a EcdsaSigner given a key.

func (*EcdsaSigner) Sign

func (s *EcdsaSigner) Sign(digest signature.Digest) (signature.Signature, error)

Sign signs a digest.

type EddsaSigner

type EddsaSigner struct {
	PrivateKey ed25519.PrivateKey
}

EddsaSigner signs using the EDDSA scheme.

func (*EddsaSigner) Sign

func (b *EddsaSigner) Sign(digest signature.Digest) (signature.Signature, error)

Sign signs a digest.

type KeyFactory

type KeyFactory interface {
	NewKeys() (signature.PrivateKey, signature.PublicKey)
	NewKeysWithSeed(int64) (signature.PrivateKey, signature.PublicKey)
}

KeyFactory generates public and private keys.

type NsSigner

type NsSigner struct {
	// contains filtered or unexported fields
}

NsSigner signs a transaction's namespace. It also implements DigestSigner.

func NewNsSigner

func NewNsSigner(scheme signature.Scheme, key []byte) (*NsSigner, error)

NewNsSigner creates a new namespace signer according to the implementation scheme.

func (*NsSigner) SignNs

func (v *NsSigner) SignNs(tx *protoblocktx.Tx, nsIndex int) (signature.Signature, error)

SignNs signs a transaction's namespace.

type SignerVerifierFactory

type SignerVerifierFactory struct {
	KeyFactory
	// contains filtered or unexported fields
}

SignerVerifierFactory implements KeyFactory and instantiate verifiers and signers. This should only be used for evaluation and testing as it might use non-secure crypto methods.

func NewSignatureFactory

func NewSignatureFactory(scheme signature.Scheme) *SignerVerifierFactory

NewSignatureFactory instantiate a SignerVerifierFactory.

func (*SignerVerifierFactory) NewSigner

NewSigner instantiate a signer given a private key.

func (*SignerVerifierFactory) NewVerifier

NewVerifier instantiate a verifier given a public key.

func (*SignerVerifierFactory) Scheme

Scheme returns the factory scheme.

func (*SignerVerifierFactory) String

func (f *SignerVerifierFactory) String() string

String returns a string representation for logging.

Jump to

Keyboard shortcuts

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