tdf3

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: BSD-3-Clause-Clear Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrHsmEncrypt = Error("hsm encrypt error")
)

Variables

This section is empty.

Functions

func EncryptWithPublicKey

func EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) ([]byte, error)

EncryptWithPublicKey encrypts data with public key

Types

type Access

type Access interface {
	Access() []KeyAccess
}

type Block

type Block struct {
	cipher.Block
	Algorithm  string
	Streamable bool
	IV         []byte
}

func (Block) Method

func (b Block) Method() EncryptionMethod

type EncryptionInformation

type EncryptionInformation struct {
	IntegrityInformation IntegrityInformation `json:"integrityInformation"`
	KeyAccess            []KeyAccess          `json:"keyAccess"`
	Method               EncryptionMethod     `json:"method"`
	Policy               string               `json:"policy"`
	Type                 string               `json:"type"`
}

type EncryptionMethod

type EncryptionMethod struct {
	Algorithm  string `json:"algorithm"`
	Streamable bool   `json:"isStreamable"`
	IV         []byte `json:"iv"`
}

type Error

type Error string

func (Error) Error

func (e Error) Error() string

type Integrity

type Integrity interface {
	Integrity() IntegrityInformation
}

type IntegrityInformation

type IntegrityInformation struct {
	EncryptedSegmentSizeDefault int           `json:"encryptedSegmentSizeDefault"`
	RootSignature               RootSignature `json:"rootSignature"`
	SegmentHashAlg              string        `json:"segmentHashAlg"`
	SegmentSizeDefault          int           `json:"segmentSizeDefault"`
	Segments                    []Segments    `json:"segments"`
}

type KeyAccess

type KeyAccess struct {
	EncryptedMetadata string `json:"encryptedMetadata,omitempty"`
	PolicyBinding     string `json:"policyBinding,omitempty"`
	Protocol          string `json:"protocol"`
	Type              string `json:"type"`
	URL               string `json:"url"`
	WrappedKey        []byte `json:"wrappedKey,omitempty"`
	Header            []byte `json:"header,omitempty"`
	Algorithm         string `json:"algorithm,omitempty"`
}

type RootSignature

type RootSignature struct {
	Alg string `json:"alg"`
	Sig []byte `json:"sig"`
}

type Segments

type Segments struct {
	EncryptedSegmentSize int    `json:"encryptedSegmentSize"`
	Hash                 []byte `json:"hash"`
	SegmentSize          int    `json:"segmentSize"`
}

Jump to

Keyboard shortcuts

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