Class PoliciesList

  • All Implemented Interfaces:
    java.io.Serializable

    public class PoliciesList
    extends java.lang.Object
    implements java.io.Serializable

    Class that represents Policy Lists.

    Project:

    Library for the integration with the services of @Firma, eVisor and TS@.

    Version:
    1.2, 19/09/2022.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int IDENTIFIER_OID_AS_UNSPECIFIED
      Constant attribute that represents that the identifier type is undefined.
      static int IDENTIFIER_OID_AS_URI
      Constant attribute that represents that the identifier is defined as URI.
      static int IDENTIFIER_OID_AS_URN
      Constant attribute that represents that the identifier is defined as URN.
    • Constructor Summary

      Constructors 
      Constructor Description
      PoliciesList()
      Constructor method for the class PoliciesList.java.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addNewPolicyIdentifier​(java.lang.String policyIdentifier, int type)
      Adds a new policy identifier if not is null.
      boolean checkCertificate​(java.security.cert.X509Certificate cert)
      Checks if the input certificate has the CertificatePolicies extension and it includes all the OIDs declared in this object.
      java.util.List<java.lang.String> getPolicyIdentifiersList()
      Gets the policy identifiers list.
      boolean isThereSomePolicyIdentifier()
      Checks if there is at least one policy identifier in the list.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • IDENTIFIER_OID_AS_URN

        public static final int IDENTIFIER_OID_AS_URN
        Constant attribute that represents that the identifier is defined as URN.
        See Also:
        Constant Field Values
      • IDENTIFIER_OID_AS_URI

        public static final int IDENTIFIER_OID_AS_URI
        Constant attribute that represents that the identifier is defined as URI.
        See Also:
        Constant Field Values
      • IDENTIFIER_OID_AS_UNSPECIFIED

        public static final int IDENTIFIER_OID_AS_UNSPECIFIED
        Constant attribute that represents that the identifier type is undefined.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PoliciesList

        public PoliciesList()
        Constructor method for the class PoliciesList.java.
    • Method Detail

      • getPolicyIdentifiersList

        public final java.util.List<java.lang.String> getPolicyIdentifiersList()
        Gets the policy identifiers list.
        Returns:
        the policy identifiers list
      • isThereSomePolicyIdentifier

        public final boolean isThereSomePolicyIdentifier()
        Checks if there is at least one policy identifier in the list.
        Returns:
        true if there is at least one policy identifier in the list, otherwise false.
      • addNewPolicyIdentifier

        public final void addNewPolicyIdentifier​(java.lang.String policyIdentifier,
                                                 int type)
        Adds a new policy identifier if not is null.
        Parameters:
        policyIdentifier - policy identifier to add.
        type - Identifier type. It must be one of the following: IDENTIFIER_OID_AS_URN, IDENTIFIER_OID_AS_URI or IDENTIFIER_OID_AS_UNSPECIFIED.
      • checkCertificate

        public final boolean checkCertificate​(java.security.cert.X509Certificate cert)
                                       throws TSLQualificationEvalProcessException
        Checks if the input certificate has the CertificatePolicies extension and it includes all the OIDs declared in this object.
        Parameters:
        cert - Certificate X509v3 to check.
        Returns:
        true if the input certificate has the CertificatePolicies extension and it includes all the OIDs declared in this object, otherwise false.
        Throws:
        TSLQualificationEvalProcessException - In case of some error evaluating the input certificate with all defined criteria.