All Downloads are FREE. Search and download functionalities are using the official Maven repository.

es.gob.afirma.signers.pades.PdfTriPhaseSession Maven / Gradle / Ivy

There is a newer version: 1.8.2
Show newest version
/* Copyright (C) 2011 [Gobierno de Espana]
 * This file is part of "Cliente @Firma".
 * "Cliente @Firma" is free software; you can redistribute it and/or modify it under the terms of:
 *   - the GNU General Public License as published by the Free Software Foundation;
 *     either version 2 of the License, or (at your option) any later version.
 *   - or The European Software License; either version 1.1 or (at your option) any later version.
 * You may contact the copyright holder at: [email protected]
 */

package es.gob.afirma.signers.pades;

import java.io.ByteArrayOutputStream;

import com.aowagie.text.pdf.PdfSignatureAppearance;

/** Datos PDF relevantes en cuanto a las firmas electrónicas, consistentes en los datos
 * a ser firmados con CAdES o PKCS#7 y los metadatos necesarios para su correcta inserción en el PDF.
 * @author Tomás García-Merás */
public final class PdfTriPhaseSession {

    private final PdfSignatureAppearance sap;
    private final ByteArrayOutputStream baos;
    private final String fileID;

    PdfTriPhaseSession(final PdfSignatureAppearance s, final ByteArrayOutputStream b, final String fid) {
        this.sap = s;
        this.baos = b;
        this.fileID = fid;
    }

    /** Obtiene el flujo de datos del propio PDF firmado.
     * @return Flujo de datos del propio PDF firmado */
    public ByteArrayOutputStream getBAOS() {
        return this.baos;
    }

    /** Devuelve el PdfSignatureAppearance de la firma PDF en curso.
     * @return PdfSignatureAppearance de la firma PDF en curso */
    public PdfSignatureAppearance getSAP() {
        return this.sap;
    }

    /** Obtiene el identificador PDF único del documento.
     * @return Identificador PDF único del documento */
    public String getFileID() {
        return this.fileID;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy