Guides
Remove Trust Certificate
The ComPDFKit SDK allows you to remove a previously trusted digital certificate. This can be useful for managing certificate trust lists dynamically based on user preferences or policy changes.
java
// Retrieve the list of currently trusted certificates
List<X509Certificate> trustedCertificates = CPDFX509.getTrustedCertificates(getContext());
// Remove the first certificate in the list (as an example)
if (!trustedCertificates.isEmpty()) {
CPDFX509.removeTrustedCertificate(getContext(), trustedCertificates.get(0));
}
kotlin
// Retrieve the list of currently trusted certificates
val trustedCertificates = CPDFX509.getTrustedCertificates(context)
// Remove the first certificate in the list (as an example)
if (trustedCertificates.isNotEmpty()) {
CPDFX509.removeTrustedCertificate(context, trustedCertificates[0])
}