SecurityLockPKIImpl.java
3.15 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityConfigurationException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException
* com.adobe.internal.pdftoolkit.core.securityframework.SecurityHandler
* com.adobe.internal.pdftoolkit.core.securityframework.SecurityManager
* com.adobe.internal.pdftoolkit.core.securityframework.impl.SecurityLockPKIInterface
* com.adobe.internal.pdftoolkit.core.securityframework.impl.SecurityProvidersImpl
* com.adobe.internal.pdftoolkit.core.securityframework.pki.Identities
*/
package com.adobe.internal.pdftoolkit.core.encryption;
import com.adobe.internal.pdftoolkit.core.encryption.PKISecurityHandler;
import com.adobe.internal.pdftoolkit.core.encryption.StandardCipherSecurityManager;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityConfigurationException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException;
import com.adobe.internal.pdftoolkit.core.securityframework.SecurityHandler;
import com.adobe.internal.pdftoolkit.core.securityframework.SecurityManager;
import com.adobe.internal.pdftoolkit.core.securityframework.impl.SecurityLockPKIInterface;
import com.adobe.internal.pdftoolkit.core.securityframework.impl.SecurityProvidersImpl;
import com.adobe.internal.pdftoolkit.core.securityframework.pki.Identities;
import java.util.Map;
public class SecurityLockPKIImpl
implements SecurityLockPKIInterface {
private SecurityManager mSecMgr;
private Map mEncryptParams;
public SecurityLockPKIImpl() {
}
private SecurityLockPKIImpl(Map encryptParams, SecurityProvidersImpl providers) throws PDFSecurityConfigurationException {
this.mSecMgr = StandardCipherSecurityManager.newInstance(encryptParams, providers);
}
public SecurityLockPKIInterface makeSecurityLock(Map encryptParams, SecurityProvidersImpl providers) throws PDFSecurityException {
return new SecurityLockPKIImpl(encryptParams, providers);
}
public SecurityManager getSecurityManager() {
return this.mSecMgr;
}
public Map getEncryptParameters() {
return this.mEncryptParams;
}
public void setEncryptParameters(Map encryptParams) {
this.mEncryptParams = encryptParams;
}
public boolean shouldEncrypt() {
return true;
}
public byte[] buildRecipients(String filterName, Identities recipients, boolean inCrypt, Map encryptParams) throws PDFSecurityException {
if (this.mSecMgr == null || filterName == null) {
throw new PDFSecurityConfigurationException("Security Manager is not defined");
}
PKISecurityHandler handler = (PKISecurityHandler)this.mSecMgr.getSecurityHandler(filterName, this.mEncryptParams);
if (handler == null) {
throw new PDFSecurityConfigurationException("Security Handler " + filterName + " is not defined");
}
try {
return handler.buildPKCS7(recipients, inCrypt, encryptParams);
}
catch (Exception e) {
throw new PDFSecurityConfigurationException("Unable to build recipients", (Throwable)e);
}
}
}