/
Aes128Security.go
39 lines (35 loc) · 1.33 KB
/
Aes128Security.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
package endpoint
/*
Represents AES 128 bit PDF document security.
AES 128 bit PDF security is compatible with PDF version 1.5 and higher and,
Adobe Acrobat Reader version 7 or higher is needed to open these documents.
Older readers will not be able to read documents encrypted with this security.
*/
type Aes128Security struct {
Security
}
/*
Initializes a new instance of the `Aes128Security` class by
taking the owner and user passwords as parameters to create PDF.
* @param {string} userPassword The owner password to open the document.
* @param {string} ownerPassword The user password to open the document.
*/
func NewAes128Security(userPwd string, ownerPwd string) *Aes128Security {
var p = Aes128Security{Security: *newSecurity(userPwd, ownerPwd)}
p.securityType = p.typeOfSecurity()
return &p
}
/*
Gets the `EncryptDocumentComponents` components of the document to be encrypted.
We can encrypt all the PDF content or the content, excluding the metadata.
*/
func (p *Aes128Security) DocumentComponents() EncryptDocumentComponents {
return p.documentComponents
}
/*
sets the `EncryptDocumentComponents` components of the document to be encrypted.
We can encrypt all the PDF content or the content, excluding the metadata.
*/
func (p *Aes128Security) SetDocumentComponents(value EncryptDocumentComponents) {
p.documentComponents = value
}