Class ASN1FormatDetector

java.lang.Object
es.juntadeandalucia.afirma.client.util.signatureFormat.ASN1FormatDetector
All Implemented Interfaces:
SpecificFormatDetectorI

public class ASN1FormatDetector extends Object implements SpecificFormatDetectorI
  • Constructor Details

    • ASN1FormatDetector

      public ASN1FormatDetector(Object sig) throws AfirmaException
      Constructor del detector ASN.1 mediante un objeto con la firma.
      Parameters:
      sig - Object, Objeto que contiene la firma. El constructor comprueba que pertenece al formato correto.
      Throws:
      AfirmaException - En caso de error
    • ASN1FormatDetector

      public ASN1FormatDetector(iaik.cms.SignedData sig) throws AfirmaException
      Constructor del detector ASN.1 mediante un objeto SignedData.
      Parameters:
      sig - SignedData, Objeto SignedData que contiene la firma.
      Throws:
      AfirmaException - En caso de error
  • Method Details

    • isBES

      public boolean isBES()
      Description copied from interface: SpecificFormatDetectorI
      Métodos para comprobar si la firma contiene los atributos firmados del formato BES.
      Specified by:
      isBES in interface SpecificFormatDetectorI
      Returns:
      boolean, true si contiene los elementos del formato BES. false si no contiene los elementos del formato BES.
    • isEPES

      public boolean isEPES()
      Description copied from interface: SpecificFormatDetectorI
      Métodos para comprobar si la firma contiene los atributos firmados del formato EPES.
      Specified by:
      isEPES in interface SpecificFormatDetectorI
      Returns:
      boolean, true si contiene los elementos del formato EPES. false si no contiene los elementos del formato EPEs.
    • isT

      public boolean isT()
      Description copied from interface: SpecificFormatDetectorI
      Métodos para comprobar si la firma contiene los atributos no firmados del formato T.
      Specified by:
      isT in interface SpecificFormatDetectorI
      Returns:
      boolean, true si contiene los elementos del formato T. false si no contiene los elementos del formato T.
    • isC

      public boolean isC()
      Description copied from interface: SpecificFormatDetectorI
      Métodos para comprobar si la firma contiene los atributos no firmados del formato C.
      Specified by:
      isC in interface SpecificFormatDetectorI
      Returns:
      boolean, true si contiene los elementos del formato C. false si no contiene los elementos del formato C.
    • isX1

      public boolean isX1()
      Description copied from interface: SpecificFormatDetectorI
      Métodos para comprobar si la firma contiene los atributos no firmados del formato X Type1.
      Specified by:
      isX1 in interface SpecificFormatDetectorI
      Returns:
      boolean, true si contiene los elementos del formato X Type1. false si no contiene los elementos del formato X Type1.
    • isX2

      public boolean isX2()
      Description copied from interface: SpecificFormatDetectorI
      Métodos para comprobar si la firma contiene los atributos no firmados del formato X Type2.
      Specified by:
      isX2 in interface SpecificFormatDetectorI
      Returns:
      boolean, true si contiene los elementos del formato X Type2. false si no contiene los elementos del formato X Type2.
    • isXL

      public boolean isXL()
      Description copied from interface: SpecificFormatDetectorI
      Métodos para comprobar si la firma contiene los atributos no firmados del formato X Long.
      Specified by:
      isXL in interface SpecificFormatDetectorI
      Returns:
      boolean, true si contiene los elementos del formato X Long. false si no contiene los elementos del formato X Long.
    • isX1L

      public boolean isX1L()
      Description copied from interface: SpecificFormatDetectorI
      Métodos para comprobar si la firma contiene los atributos no firmados del formato X Long Type1.
      Specified by:
      isX1L in interface SpecificFormatDetectorI
      Returns:
      boolean, true si contiene los elementos del formato X Long Type1. false si no contiene los elementos del formato X Long Type1.
    • isX2L

      public boolean isX2L()
      Description copied from interface: SpecificFormatDetectorI
      Métodos para comprobar si la firma contiene los atributos no firmados del formato X Long Type2.
      Specified by:
      isX2L in interface SpecificFormatDetectorI
      Returns:
      boolean, true si contiene los elementos del formato X Long Type2. false si no contiene los elementos del formato X Long type2.
    • isA

      public boolean isA()
      Description copied from interface: SpecificFormatDetectorI
      Métodos para comprobar si la firma contiene los atributos no firmados del formato A.
      Specified by:
      isA in interface SpecificFormatDetectorI
      Returns:
      boolean, true si contiene los elementos del formato A. false si no contiene los elementos del formato A.
    • resolveBasicFormat

      public String resolveBasicFormat()
      Description copied from interface: SpecificFormatDetectorI
      Método que resuelve el formato básico de una firma electrónica con formato desconocido.

      Este método se ejecuta automaticamente al crear el objeto con el siguiente constructor:


      new XXXFormatDetector(Object sig)


      Para otros constructores será necesario invocar el método para hallar el formato básico.

      Specified by:
      resolveBasicFormat in interface SpecificFormatDetectorI
      Returns:
      String, Devuelve el formato básico de la firma de entre los formatos BES definidos en esta interfaz.
    • resolveSignatureFormat

      public String resolveSignatureFormat()
      Description copied from interface: SpecificFormatDetectorI
      Método que resuelve el formato extendido de una firma electrónica con formato desconocido.
      Specified by:
      resolveSignatureFormat in interface SpecificFormatDetectorI
      Returns:
      String, Devuelve el formato extendido de la firma de entre los formatos definidos en esta interfaz.
    • getBasicFormat

      public String getBasicFormat()
      Description copied from interface: SpecificFormatDetectorI
      Método que devuelve el formato básico de la firma electrónica detectado hasta el momento.
      Specified by:
      getBasicFormat in interface SpecificFormatDetectorI
      Returns:
      String, Devuelve el formato de la firma de entre los formatos básicos definidos en esta interfaz.
    • getSpecificFormat

      public String getSpecificFormat()
      Description copied from interface: SpecificFormatDetectorI
      Método que devuelve el formato específico de la firma electrónica detectado hasta el momento.
      Specified by:
      getSpecificFormat in interface SpecificFormatDetectorI
      Returns:
      String, Devuelve el formato de la firma de entre los formatos específicos definidos en esta interfaz.
    • isEPES

      public static boolean isEPES(iaik.cms.SignerInfo si)
    • isT

      public static boolean isT(iaik.cms.SignerInfo si)
    • isC

      public static boolean isC(iaik.cms.SignerInfo si)
    • isX1

      public static boolean isX1(iaik.cms.SignerInfo si)
    • isX2

      public static boolean isX2(iaik.cms.SignerInfo si)
    • isXL

      public static boolean isXL(iaik.cms.SignerInfo si)
    • isX1L

      public static boolean isX1L(iaik.cms.SignerInfo si)
    • isX2L

      public static boolean isX2L(iaik.cms.SignerInfo si)
    • isA

      public static boolean isA(iaik.cms.SignerInfo si)
    • isSignatureFormatUpperThanTheFormat

      public boolean isSignatureFormatUpperThanTheFormat(String signatureFormat, String formatToTest)
      Description copied from interface: SpecificFormatDetectorI
      Method that indicates whether the signature format contained in signatureFormat input parameter is more advanced than indicated in formatToTest.
      Specified by:
      isSignatureFormatUpperThanTheFormat in interface SpecificFormatDetectorI
      Parameters:
      signatureFormat - Signature format you want to check if it is more advanced.
      formatToTest - Signature format taking as a basis for comparison.
      Returns:
      true if the indicated signature format is more advanced than the taking as a basis for comparison. false otherwise.
    • isSignatureFormatUpperOrEqualThanTheFormat

      public boolean isSignatureFormatUpperOrEqualThanTheFormat(String signatureFormat, String formatToTest)
      Description copied from interface: SpecificFormatDetectorI
      Method that indicates whether the signature format contained in signatureFormat input parameter is equal or more advanced than indicated in formatToTest.
      Specified by:
      isSignatureFormatUpperOrEqualThanTheFormat in interface SpecificFormatDetectorI
      Parameters:
      signatureFormat - Signature format you want to check if it is equal or more advanced.
      formatToTest - Signature format taking as a basis for comparison.
      Returns:
      true if the indicated signature format is equal or more advanced than the taking as a basis for comparison. false otherwise.
    • getDigestAlgorithmImplementation

      public String getDigestAlgorithmImplementation() throws NoSuchAlgorithmException
      Specified by:
      getDigestAlgorithmImplementation in interface SpecificFormatDetectorI
      Throws:
      NoSuchAlgorithmException