Spire.PDF-for-Java
Spire.PDF-for-Java copied to clipboard
How to get certification public key from ?
PdfField pf = wc.get(i); if (pf instanceof PdfSignatureFieldWidget) { PdfSignatureFieldWidget sfw = (PdfSignatureFieldWidget) pf; PdfSignature sn = sfw.getSignature(); X509Certificate2 x509 = sn.getCertificates().get_Item(0); issuer = sn.getCertificate().get_IssuerName().getName(); if (sn.verifySignature() && issuers.contains(issuer)) { log.info("issuer={}\nissuers=", issuer, issuers); return issuer; } } Here could not get the certificate public key via the X509Certificate2 x509 = sn.getCertificates().
Thanks for your question. Sorry, we don't support getting the public key from the certificate. If you have any further questions, please feel free to write to us.