signer

package
v0.0.0-...-1a43b3b Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommonSignChunkSize64K = 65536
)

Variables

View Source
var (
	ErrSignIncomplete = errors.New("signature data incomplete")
	ErrSignCrc        = errors.New("sign crc32 incorrect")
)

Functions

func SignMarshall

func SignMarshall(signs []uint32) []byte

func SignUnmarshall

func SignUnmarshall(signData []byte) ([]uint32, error)

Types

type BlobSign

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

func NewBlobSign

func NewBlobSign(signB []byte) (*BlobSign, error)

func (*BlobSign) Bytes

func (bs *BlobSign) Bytes() []byte

func (*BlobSign) Get

func (bs *BlobSign) Get(seq int64) uint32

func (*BlobSign) Len

func (bs *BlobSign) Len() int

type BlobSignManager

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

func NewBlobSignManager

func NewBlobSignManager() *BlobSignManager

func (*BlobSignManager) Add

func (bsm *BlobSignManager) Add(in *goproto.BlobKey, bs *BlobSign)

func (*BlobSignManager) Get

func (bsm *BlobSignManager) Get(in *goproto.BlobKey) (bs *BlobSign, ok bool)

type DataSigner

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

func NewDataSigner

func NewDataSigner(dataSize uint64) *DataSigner

func (*DataSigner) Close

func (s *DataSigner) Close()

func (*DataSigner) Sum

func (s *DataSigner) Sum() []uint32

Sum return not a copy but a ref SAFETY DECLARATION: []uint32 return by this function should not be used after Close() called

func (*DataSigner) Write

func (s *DataSigner) Write(p []byte) (nn int, err error)

type SignedFile

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

func NewSignedFile

func NewSignedFile(fd io.ReadSeekCloser, fsize uint64, bs *BlobSign) *SignedFile

func (*SignedFile) Close

func (f *SignedFile) Close() error

Close will return this SignedFile to pool, after calling close, this SignedFile should never be used again.

func (*SignedFile) Read

func (f *SignedFile) Read(p []byte) (n int, err error)

func (*SignedFile) Seek

func (f *SignedFile) Seek(offset int64, whence int) (int64, error)

Jump to

Keyboard shortcuts

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