su3

package
v0.0.0-...-9603753 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2016 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIN_VERSION_LENGTH = 16

	SIGTYPE_DSA          = uint16(0)
	SIGTYPE_ECDSA_SHA256 = uint16(1)
	SIGTYPE_ECDSA_SHA384 = uint16(2)
	SIGTYPE_ECDSA_SHA512 = uint16(3)
	SIGTYPE_RSA_SHA256   = uint16(4)
	SIGTYPE_RSA_SHA384   = uint16(5)
	SIGTYPE_RSA_SHA512   = uint16(6)

	CONTENT_TYPE_UNKNOWN = uint8(0)
	CONTENT_TYPE_ROUTER  = uint8(1)
	CONTENT_TYPE_PLUGIN  = uint8(2)
	CONTENT_TYPE_RESEED  = uint8(3)
	CONTENT_TYPE_NEWS    = uint8(4)

	FILE_TYPE_ZIP   = uint8(0)
	FILE_TYPE_XML   = uint8(1)
	FILE_TYPE_HTML  = uint8(2)
	FILE_TYPE_XMLGZ = uint8(3)
)

Variables

View Source
var (
	MAGIC_BYTES = []byte("I2Psu3")
)

Functions

func NewSigningCertificate

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

Types

type Su3File

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

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

func NewSu3File

func NewSu3File() *Su3File

func (*Su3File) BodyBytes

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

func (*Su3File) MarshalBinary

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

func (*Su3File) Sign

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

func (*Su3File) String

func (s *Su3File) String() string

func (*Su3File) UnmarshalBinary

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

func (*Su3File) VerifySignature

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

Jump to

Keyboard shortcuts

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