Class CPDFX509

java.lang.Object
com.compdfkit.core.signature.CPDFX509

public class CPDFX509 extends Object
  • Field Details

    • exportCertificateDir

      public static final String exportCertificateDir
  • Constructor Details

    • CPDFX509

      public CPDFX509(long psox509Ptr, CPDFCertInfo certInfo)
    • CPDFX509

      public CPDFX509()
  • Method Details

    • getCertInfo

      public CPDFCertInfo getCertInfo()
      Get certificate infomation.
      Returns:
      Returns the CPDFCertInfo object.
    • isValid

      public boolean isValid()
      Whether the certificate pointer is valid.
      Returns:
      Returns true:pointer is valid, false:invalid.
    • getPsox509Ptr

      public long getPsox509Ptr()
      Get the certificate pointer.
      Returns:
      Returns the certificate point.
    • verifyGetChain

      public boolean verifyGetChain(String capath, CPDFSignature signature)
      Verify certificate chain.
      Parameters:
      capath - Certificate folder directory, excluding certificate name.
      signature - The signature to verify.
      Returns:
      Returns true:verify succeed, false:fail.
    • isExpired

      public boolean isExpired()
      Whether the certificate is expired.
      Returns:
      Returns true:expired, false:not expired.
    • getChain

      public CPDFX509[] getChain()
      Get the trusted certificate chain.
      Returns:
      Returns certificate array.
    • exportToFilePath

      public boolean exportToFilePath(String path, CPDFX509.CertFormatType type)
      Export the certificate to file.
      Parameters:
      path - Certificate save path.
      type - Certificate type.
      Returns:
      Returns true:export succeed, false:fail.
    • getBasicConstraints

      public String getBasicConstraints()
      Get basic constraints info.
      Returns:
      Returns basic constraints info.
    • verifyOCSP

      public boolean verifyOCSP()
      OCSP authentication
      Returns:
      Returns true:verify OCSP succeed, false: fail
    • checkCertificateIsTrusted

      public boolean checkCertificateIsTrusted(String trustDir)
      Whether the certificate is in trusted list.
      Parameters:
      trustDir - Certificate storage directory.
      Returns:
      Returns true:certificate is in trusted list, false: not in.
    • addToTrustedCertificates

      public boolean addToTrustedCertificates(String trustDir, String fileName)
      Add certificate to truested list.
      Parameters:
      trustDir - Certificate storage directory.
      fileName - Certificate file name.
      Returns:
      Returns true:add succeed, false:fail.
    • getCertPathInPath

      public String getCertPathInPath(String certDir)
      Get the path to the certificate in the certificate storage directory.
      Parameters:
      certDir - Certificate storage directory.
      Returns:
      Returns path to the certificate.