encrypt

package
v0.0.0-...-f56eaae Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: BSD-3-Clause Imports: 22 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbortNotification

func AbortNotification(pub Publication, lcpsv string, v2 bool, username string, password string) error

AbortNotification rolls back the notification of the encryption of a publication

func NotifyCMS

func NotifyCMS(pub Publication, notifyURL string, verbose bool) error

NotifyCMS notifies a CMS of the encryption of a publication

func NotifyLCPServer

func NotifyLCPServer(pub Publication, lcpsv string, v2 bool, username string, password string, verbose bool) error

NotifyLCPServer notifies the License Server of the encryption of a publication

func StoreS3Publication

func StoreS3Publication(inputPath, storagePath, name string) error

StoreS3Publication stores an encrypted file into its definitive storage. Only called for S3 buckets.

Types

type CMSMsg

type CMSMsg struct {
	UUID          string   `json:"uuid"`
	Title         string   `json:"title"`
	ContentType   string   `json:"content_type"`
	DatePublished string   `json:"date_published"`
	Description   string   `json:"description"`
	CoverUrl      string   `json:"cover_url,omitempty"`
	Language      []Coded  `json:"language"`
	Publisher     []Entity `json:"publisher"`
	Author        []Entity `json:"author"`
	Category      []Entity `json:"category"`
}

CMSMsg is used for notifying a CMS

type Coded

type Coded struct {
	Code string `json:"code"`
}

type Entity

type Entity struct {
	Name string `json:"name"`
}

type LCPServerMsgV2

type LCPServerMsgV2 struct {
	UUID          string `json:"uuid"`
	Title         string `json:"title"`
	EncryptionKey []byte `json:"encryption_key"`
	Location      string `json:"location"`
	ContentType   string `json:"content_type"`
	Size          uint32 `json:"size"`
	Checksum      string `json:"checksum"`
}

LCPServerMsgV2 is used for notifying an LCP Server V2

type Publication

type Publication struct {
	UUID          string
	Title         string
	Date          string
	Description   string
	Language      []string
	Publisher     []string
	Author        []string
	Subject       []string
	CoverUrl      string
	StorageMode   int
	FileName      string
	EncryptionKey []byte
	Location      string
	ContentType   string
	Size          uint32
	Checksum      string
}

Publication aggregates information during the process

func ProcessEncryption

func ProcessEncryption(contentID, contentKey, inputPath, tempRepo, outputRepo, storageRepo, storageURL, storageFilename string, extractCover bool) (*Publication, error)

ProcessEncryption encrypts a publication inputPath must contain a processable file extension (EPUB, PDF, LPF or RPF)

Jump to

Keyboard shortcuts

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