pesign

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package pesign implements the PE (portable executable) signing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateSigner

type CertificateSigner interface {
	Signer() crypto.Signer
	Certificate() *x509.Certificate
}

CertificateSigner is a provider of the certificate and the signer.

type PCRSigner

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

PCRSigner implements measure.RSAKey interface.

func NewPCRSigner

func NewPCRSigner(keyPath string) (*PCRSigner, error)

NewPCRSigner creates a new PCR signer from the private key file.

func (*PCRSigner) Public

func (s *PCRSigner) Public() crypto.PublicKey

Public returns the public key.

func (*PCRSigner) PublicRSAKey

func (s *PCRSigner) PublicRSAKey() *rsa.PublicKey

PublicRSAKey returns the public key.

func (*PCRSigner) Sign

func (s *PCRSigner) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error)

Sign implements the crypto.Signer interface.

type SecureBootSigner

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

SecureBootSigner implements pesign.CertificateSigner interface.

func NewSecureBootSigner

func NewSecureBootSigner(certPath, keyPath string) (*SecureBootSigner, error)

func (*SecureBootSigner) Certificate

func (s *SecureBootSigner) Certificate() *x509.Certificate

Certificate returns the certificate.

func (*SecureBootSigner) Signer

func (s *SecureBootSigner) Signer() crypto.Signer

Signer returns the signer.

type Signer

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

Signer sigs PE (portable executable) files.

func NewSigner

func NewSigner(provider CertificateSigner) (*Signer, error)

NewSigner creates a new Signer.

func (*Signer) Sign

func (s *Signer) Sign(input, output string) error

Sign signs the input file and writes the output to the output file.

func (*Signer) VerifyFile added in v0.2.2

func (s *Signer) VerifyFile(file string) (bool, error)

type SigningKeyAndCertificate

type SigningKeyAndCertificate struct {
	// File-based.
	//
	// Static key and certificate paths.
	KeyPath  string `yaml:"keyPath,omitempty"`
	CertPath string `yaml:"certPath,omitempty"`
}

SigningKeyAndCertificate describes a signing key & certificate.

Jump to

Keyboard shortcuts

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