Record Class LpaValidator

java.lang.Object
java.lang.Record
br.ufsc.labsec.signature.conformanceVerifier.signaturePolicy.lpa.LpaValidator
Record Components:
signaturePolicyComponent - Componente de política de assinatura

public record LpaValidator(SignaturePolicyComponent signaturePolicyComponent) extends Record
Esta classe é responsável pela validação de uma Lista de Políticas de Assinatura (LPA). A validação é feita de acordo com o tipo de LPA, que pode ser XML ou ASN.1. A verificação do arquivo de LPA é feita fazendo uma verificação como um arquivo de assinatura comum, utilizando um VerifierRequest e chamando o método verify com o parâmetro isComplete como falso; com isso, as assinaturas da LPA são verificadas sem levar em consideração qualquer política de assinatura que contenha o arquivo (por poder levar a um loop infinito).
  • Constructor Details

    • LpaValidator

      public LpaValidator(SignaturePolicyComponent signaturePolicyComponent)
      Construtor
      Parameters:
      signaturePolicyComponent - O componente de políticas de assinatura
  • Method Details

    • validate

      public LpaReport validate(Lpa<Signature<?>> lpa, Profile.AdESType type)
      Valida a LPA
      Parameters:
      type - O tipo da LPA
    • reportDefaultInformation

      public LpaReport reportDefaultInformation(Lpa<Signature<?>> lpa, String adesType)
      Inicializa os valores do relatório com valores padrão
    • verifyLpaExpirationDate

      public static void verifyLpaExpirationDate(Lpa<Signature<?>> lpa, LpaReport lpaReport, Report report, Date currentTimeReference)
      Verifica se a LPA estava expirada no momento da assinatura
      Parameters:
      report - O relatório de validação da LPA
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • signaturePolicyComponent

      public SignaturePolicyComponent signaturePolicyComponent()
      Returns the value of the signaturePolicyComponent record component.
      Returns:
      the value of the signaturePolicyComponent record component