IdentityEncryptionHandler.java 2.33 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.adobe.internal.io.stream.IO
 *  com.adobe.internal.io.stream.InputByteStream
 *  com.adobe.internal.io.stream.OutputByteStream
 *  com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException
 *  com.adobe.internal.pdftoolkit.core.securityframework.EncryptionHandler
 *  com.adobe.internal.pdftoolkit.core.securityframework.EncryptionHandlerState
 *  com.adobe.internal.pdftoolkit.core.securityframework.SecurityHandler
 */
package com.adobe.internal.pdftoolkit.core.encryption;

import com.adobe.internal.io.stream.IO;
import com.adobe.internal.io.stream.InputByteStream;
import com.adobe.internal.io.stream.OutputByteStream;
import com.adobe.internal.pdftoolkit.core.encryption.IdentityEncryptionHandlerState;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException;
import com.adobe.internal.pdftoolkit.core.securityframework.EncryptionHandler;
import com.adobe.internal.pdftoolkit.core.securityframework.EncryptionHandlerState;
import com.adobe.internal.pdftoolkit.core.securityframework.SecurityHandler;
import java.io.IOException;

public final class IdentityEncryptionHandler
implements EncryptionHandler {
    public byte[] encrypt(byte[] content, byte[] key) {
        return content;
    }

    public byte[] decrypt(byte[] content, byte[] key) {
        return content;
    }

    public void encrypt(InputByteStream src, OutputByteStream dest, byte[] key) throws PDFIOException {
        try {
            IO.copy((InputByteStream)src, (OutputByteStream)dest);
        }
        catch (IOException e) {
            throw new PDFIOException((Throwable)e);
        }
    }

    public void decrypt(InputByteStream src, OutputByteStream dest, byte[] key) throws PDFIOException {
        try {
            IO.copy((InputByteStream)src, (OutputByteStream)dest);
        }
        catch (IOException e) {
            throw new PDFIOException((Throwable)e);
        }
    }

    public byte[] getBaseEncryptionKey() {
        return null;
    }

    public SecurityHandler getSecurityHandler() {
        return null;
    }

    public String getAlgorithm() {
        return "Identity";
    }

    public String getHandlerName() {
        return "";
    }

    public EncryptionHandlerState createEncryptionHandlerState() {
        return new IdentityEncryptionHandlerState();
    }
}