Class UtilsCertificateCommons


  • public final class UtilsCertificateCommons
    extends java.lang.Object

    Class that provides methods for managing certificates and private keys.

    Project:

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

    Version:
    1.2, 14/03/2017.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String canonicalizeX500Principal​(java.lang.String x500PrincipalName)
      Method that canonicalizes a X.500 Principal of a certificate.
      static boolean equals​(java.security.cert.X509Certificate cert1, java.security.cert.X509Certificate cert2)
      Method that indicates whether some other certificate is "equal to" this one (true) or not (false).
      static java.security.cert.X509Certificate generateCertificate​(byte[] certificateBytes)
      Method that obtains a certificate from the bytes array.
      • Methods inherited from class java.lang.Object

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

      • canonicalizeX500Principal

        public static java.lang.String canonicalizeX500Principal​(java.lang.String x500PrincipalName)
        Method that canonicalizes a X.500 Principal of a certificate.
        Parameters:
        x500PrincipalName - Parameter that represents the value of the X.500 Principal of the certificate to canonicalize.
        Returns:
        the canonicalized X.500 Principal.
      • generateCertificate

        public static java.security.cert.X509Certificate generateCertificate​(byte[] certificateBytes)
                                                                      throws java.security.cert.CertificateException
        Method that obtains a certificate from the bytes array.
        Parameters:
        certificateBytes - Parameter that represents the certificate.
        Returns:
        an object that represents the certificate.
        Throws:
        java.security.cert.CertificateException - If there is a parsing error.
      • equals

        public static boolean equals​(java.security.cert.X509Certificate cert1,
                                     java.security.cert.X509Certificate cert2)
        Method that indicates whether some other certificate is "equal to" this one (true) or not (false).
        Parameters:
        cert1 - Parameter that represents the first certificate to compare.
        cert2 - Parameter that represents the second certificate to compare.
        Returns:
        a boolean that indicates whether some other certificate is "equal to" this one (true) or not (false).