xmlenc

package
v0.0.0-...-99fd3eb Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CipherData

type CipherData struct {
	CipherReference CipherReference `xml:"http://www.w3.org/2001/04/xmlenc# CipherReference"`
	Value           []byte          `xml:"Value,omitempty"`
}

type CipherReference

type CipherReference struct {
	URI URI `xml:"URI,attr"`
}

type Compression

type Compression struct {
	Method         int    `xml:"Method,attr"`
	OriginalLength uint64 `xml:"OriginalLength,attr"`
}

type Data

type Data struct {
	Properties *EncryptionProperties `xml:"http://www.w3.org/2001/04/xmlenc# EncryptionProperties,omitempty"`
	// contains filtered or unexported fields
}

type EncryptionProperties

type EncryptionProperties struct {
	Properties []EncryptionProperty `xml:"http://www.w3.org/2001/04/xmlenc# EncryptionProperty"`
}

type EncryptionProperty

type EncryptionProperty struct {
	Compression Compression `xml:"http://www.idpf.org/2016/encryption#compression Compression"`
}

type Key

type Key struct {
	References     ReferenceList
	CarriedKeyName string
	Recipient      string
	// contains filtered or unexported fields
}

type KeyInfo

type KeyInfo struct {
	KeyName string `xml:"KeyName,attr,omitempty"`
	//KeyValue
	RetrievalMethod RetrievalMethod `xml:"http://www.w3.org/2000/09/xmldsig# RetrievalMethod"`
}

type Manifest

type Manifest struct {
	//Keys []Key
	Data    []Data   `xml:"http://www.w3.org/2001/04/xmlenc# EncryptedData"`
	XMLName struct{} `xml:"urn:oasis:names:tc:opendocument:xmlns:container encryption"`
}

func Read

func Read(r io.Reader) (Manifest, error)

Read parses the encryption XML structure

func (Manifest) DataForFile

func (m Manifest) DataForFile(path string) (Data, bool)

DataForFile returns the EncryptedData item corresponding to a given path

func (Manifest) Write

func (m Manifest) Write(w io.Writer) error

Write writes the encryption XML structure

type Method

type Method struct {
	KeySize int `xml:"KeySize,omitempty"`
	//OAEPParams []byte `xml:"AOEParams,omitempty"`
	Algorithm URI `xml:"Algorithm,attr,omitempty"`
}

type ReferenceList

type ReferenceList struct {
	Key  []string
	Data []string
}

type RetrievalMethod

type RetrievalMethod struct {
	URI  `xml:"URI,attr"`
	Type string `xml:"Type,attr"`
}

type URI

type URI string

Jump to

Keyboard shortcuts

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