Package com.compdfkit.core.signature
Class CPDFX509
java.lang.Object
com.compdfkit.core.signature.CPDFX509
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddToTrustedCertificates(String trustDir, String fileName) Add certificate to truested list.booleancheckCertificateIsTrusted(String trustDir) Whether the certificate is in trusted list.booleanexportToFilePath(String path, CPDFX509.CertFormatType type) Export the certificate to file.Get basic constraints info.Get certificate infomation.getCertPathInPath(String certDir) Get the path to the certificate in the certificate storage directory.CPDFX509[]getChain()Get the trusted certificate chain.longGet the certificate pointer.booleanWhether the certificate is expired.booleanisValid()Whether the certificate pointer is valid.booleanverifyGetChain(String capath, CPDFSignature signature) Verify certificate chain.booleanOCSP authentication
-
Field Details
-
exportCertificateDir
-
-
Constructor Details
-
CPDFX509
-
CPDFX509
public CPDFX509()
-
-
Method Details
-
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
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
Get the trusted certificate chain.- Returns:
- Returns certificate array.
-
exportToFilePath
Export the certificate to file.- Parameters:
path- Certificate save path.type- Certificate type.- Returns:
- Returns true:export succeed, false:fail.
-
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
Whether the certificate is in trusted list.- Parameters:
trustDir- Certificate storage directory.- Returns:
- Returns true:certificate is in trusted list, false: not in.
-
addToTrustedCertificates
Add certificate to truested list.- Parameters:
trustDir- Certificate storage directory.fileName- Certificate file name.- Returns:
- Returns true:add succeed, false:fail.
-
getCertPathInPath
Get the path to the certificate in the certificate storage directory.- Parameters:
certDir- Certificate storage directory.- Returns:
- Returns path to the certificate.
-