su3

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: MIT Imports: 15 Imported by: 4

Documentation

Index

Constants

View Source
const (
	SigTypeDSA             = uint16(0)
	SigTypeECDSAWithSHA256 = uint16(1)
	SigTypeECDSAWithSHA384 = uint16(2)
	SigTypeECDSAWithSHA512 = uint16(3)
	SigTypeRSAWithSHA256   = uint16(4)
	SigTypeRSAWithSHA384   = uint16(5)
	SigTypeRSAWithSHA512   = uint16(6)

	ContentTypeUnknown   = uint8(0)
	ContentTypeRouter    = uint8(1)
	ContentTypePlugin    = uint8(2)
	ContentTypeReseed    = uint8(3)
	ContentTypeNews      = uint8(4)
	ContentTypeBlocklist = uint8(5)

	FileTypeZIP   = uint8(0)
	FileTypeXML   = uint8(1)
	FileTypeHTML  = uint8(2)
	FileTypeXMLGZ = uint8(3)
	FileTypeTXTGZ = uint8(4)
	FileTypeDMG   = uint8(5)
	FileTypeEXE   = uint8(6)
)

Variables

This section is empty.

Functions

func NewSigningCertificate

func NewSigningCertificate(signerID string, privateKey *rsa.PrivateKey) ([]byte, error)

Types

type File

type File struct {
	Format        uint8
	SignatureType uint16
	FileType      uint8
	ContentType   uint8

	Version     []byte
	SignerID    []byte
	Content     []byte
	Signature   []byte
	SignedBytes []byte
}

func New

func New() *File

func (*File) BodyBytes

func (s *File) BodyBytes() []byte

func (*File) MarshalBinary

func (s *File) MarshalBinary() ([]byte, error)

func (*File) Sign

func (s *File) Sign(privkey *rsa.PrivateKey) error

func (*File) String

func (s *File) String() string

func (*File) UnmarshalBinary

func (s *File) UnmarshalBinary(data []byte) error

func (*File) VerifySignature

func (s *File) VerifySignature(cert *x509.Certificate) error

Jump to

Keyboard shortcuts

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