forked from Feedbooks/epub
-
Notifications
You must be signed in to change notification settings - Fork 2
/
encryption.go
45 lines (37 loc) · 1.28 KB
/
encryption.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package epub
//Encryption encryption.xml
type Encryption struct {
EncryptedData []EncryptedData `xml:"EncryptedData" json:"encrypted_data"`
}
//EncryptedData provides encryption information
type EncryptedData struct {
EncryptionMethod EncryptionMethod `xml:"EncryptionMethod"`
KeyInfo KeyInfo `xml:"KeyInfo"`
CipherData CipherData `xml:"CipherData"`
EncryptionProperties []EncryptionProperty `xml:"EncryptionProperties>EncryptionProperty"`
}
// EncryptionProperty provides encryption compression information
type EncryptionProperty struct {
Compression Compression `xml:"Compression"`
}
// Compression provides encryption compression details
type Compression struct {
Method string `xml:"Method,attr"`
OriginalLength string `xml:"OriginalLength,attr"`
}
// EncryptionMethod provides the encryption algorithm
type EncryptionMethod struct {
Algorithm string `xml:"Algorithm,attr"`
}
// KeyInfo provides the encryption key details
type KeyInfo struct {
Resource string `xml:",chardata"`
}
// CipherData provides the encryption cipher information
type CipherData struct {
CipherReference CipherReference `xml:"CipherReference"`
}
// CipherReference provides the encryption
type CipherReference struct {
URI string `xml:"URI,attr"`
}