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

se.idsec.signservice.integration.document.pdf.utils.PDFIntegrationUtils Maven / Gradle / Ivy

There is a newer version: 2.3.0
Show newest version
package se.idsec.signservice.integration.document.pdf.utils;

import se.idsec.signservice.integration.document.TbsDocument;
import se.idsec.signservice.security.sign.AdesProfileType;

/**
 * Utilities for PDF integration implementations.
 *
 * @author Martin Lindström ([email protected])
 * @author Stefan Santesson ([email protected])
 */
public class PDFIntegrationUtils {

  /**
   * Get the {@link AdesProfileType} for a PAdES requirement in a {@link TbsDocument}.
   * 
   * @param requestedAdes
   *          AdES requirement
   * @return enum the AdES requirement
   */
  public static AdesProfileType getPadesRequirement(final TbsDocument.EtsiAdesRequirement requestedAdes) {
    if (requestedAdes != null) {
      final TbsDocument.AdesType adesType = requestedAdes.getAdesFormat();
      if (TbsDocument.AdesType.BES.equals(adesType)) {
        return AdesProfileType.BES;
      }
      else if (TbsDocument.AdesType.EPES.equals(adesType)) {
        return AdesProfileType.EPES;
      }
    }
    return AdesProfileType.None; 
  }

  private PDFIntegrationUtils() {
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy