DecryptedStatePKI.java 2.45 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.adobe.internal.pdftoolkit.core.cos.CosDictionary
 *  com.adobe.internal.pdftoolkit.core.cos.CosDocument
 *  com.adobe.internal.pdftoolkit.core.cos.CosEncryption
 *  com.adobe.internal.pdftoolkit.core.exceptions.PDFCosParseException
 *  com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException
 *  com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException
 *  com.adobe.internal.pdftoolkit.core.securityframework.DecryptedState
 *  com.adobe.internal.pdftoolkit.core.securityframework.SecurityManager
 */
package com.adobe.internal.pdftoolkit.core.encryption;

import com.adobe.internal.pdftoolkit.core.cos.CosDictionary;
import com.adobe.internal.pdftoolkit.core.cos.CosDocument;
import com.adobe.internal.pdftoolkit.core.cos.CosEncryption;
import com.adobe.internal.pdftoolkit.core.encryption.StandardCipherSecurityManager;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFCosParseException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException;
import com.adobe.internal.pdftoolkit.core.securityframework.DecryptedState;
import com.adobe.internal.pdftoolkit.core.securityframework.SecurityManager;
import java.util.HashMap;
import java.util.Map;

public class DecryptedStatePKI
implements DecryptedState {
    private HashMap<String, byte[]> cryptFilterEncryptKeyMap = new HashMap();
    private static final long serialVersionUID = -7117026973528299629L;
    private byte[] encryptKey;
    private Integer perms;

    public byte[] getEncryptKey() {
        return this.encryptKey;
    }

    public void setEncryptKey(byte[] encryptKey) {
        this.encryptKey = encryptKey;
    }

    public void setPerms(Integer mPerms) {
        this.perms = mPerms;
    }

    public Integer getPerms() {
        return this.perms;
    }

    public SecurityManager getSecurityManager(CosDocument cosDocument) throws PDFCosParseException, PDFIOException, PDFSecurityException {
        Map params = (Map)cosDocument.getEncryption().getEncryption().getValue();
        return StandardCipherSecurityManager.newInstance(null, params, null);
    }

    public byte[] getEncryptKey(String cryptFilter) {
        return this.cryptFilterEncryptKeyMap.get(cryptFilter);
    }

    public void setEncryptKey(String cryptFilter, byte[] encryptKey) {
        this.cryptFilterEncryptKeyMap.put(cryptFilter, encryptKey);
    }
}