if (identity.getPublicKey() != null) { sb.append(", algo=").append(identity.getPublicKey().getAlgorithm()); if (identity.getCertificate() != null) { String subject = X509Util.getRfc4519Name( identity.getCertificate().getSubjectX500Principal()); sb.append(", subject='").append(subject).append("'");
if (identity.getPublicKey() != null) { sb.append(", algo=").append(identity.getPublicKey().getAlgorithm()); if (identity.getCertificate() != null) { String subject = X509Util.getRfc4519Name( identity.getCertificate().getSubjectX500Principal()); sb.append(", subject='").append(subject).append("'");
/** * Exports the certificate of the given identifier {@code objectId}. * * @param objectId * Object identifier. Must not be {@code null}. * @return the exported certificate * @throws CertificateException * if process with certificate fails. * @throws P11TokenException * if PKCS#11 token exception occurs. */ public X509Certificate exportCert(P11ObjectIdentifier objectId) throws P11TokenException { ParamUtil.requireNonNull("objectId", objectId); try { return getIdentity(objectId).getCertificate(); } catch (P11UnknownEntityException ex) { // CHECKSTYLE:SKIP } X509Cert cert = certificates.get(objectId); if (cert == null) { throw new P11UnknownEntityException(slotId, objectId); } return cert.getCert(); }
/** * Exports the certificate of the given identifier {@code objectId}. * * @param objectId * Object identifier. Must not be {@code null}. * @return the exported certificate * @throws CertificateException * if process with certificate fails. * @throws P11TokenException * if PKCS#11 token exception occurs. */ public X509Certificate exportCert(P11ObjectIdentifier objectId) throws P11TokenException { Args.notNull(objectId, "objectId"); try { return getIdentity(objectId).getCertificate(); } catch (P11UnknownEntityException ex) { // CHECKSTYLE:SKIP } X509Cert cert = certificates.get(objectId); if (cert == null) { throw new P11UnknownEntityException(slotId, objectId); } return cert.getCert(); }
X509Certificate signerCertInP11 = identity.getCertificate(); PublicKey publicKeyInP11 = (signerCertInP11 != null) ? signerCertInP11.getPublicKey() : identity.getPublicKey();
X509Certificate signerCertInP11 = identity.getCertificate(); PublicKey publicKeyInP11 = (signerCertInP11 != null) ? signerCertInP11.getPublicKey() : identity.getPublicKey();