public CaInfo(MgmtEntry.Ca caEntry, CertStore certStore) throws OperationException { this.caEntry = Args.notNull(caEntry, "caEntry"); this.certStore = Args.notNull(certStore, "certStore"); X509Certificate cert = caEntry.getCert(); this.notBefore = cert.getNotBefore(); this.notAfter = cert.getNotAfter(); this.serialNumber = cert.getSerialNumber(); this.selfSigned = cert.getIssuerX500Principal().equals(cert.getSubjectX500Principal()); Certificate bcCert; try { byte[] encodedCert = cert.getEncoded(); bcCert = Certificate.getInstance(encodedCert); } catch (CertificateEncodingException ex) { throw new OperationException(ErrorCode.SYSTEM_FAILURE, "could not encode the CA certificate"); } this.certInCmpFormat = new CMPCertificate(bcCert); this.publicCaInfo = new PublicCaInfo(cert, caEntry.getCaUris(), caEntry.getExtraControl()); this.noNewCertificateAfter = notAfter.getTime() - MS_PER_DAY * caEntry.getExpirationPeriod(); this.randomSnGenerator = RandomSerialNumberGenerator.getInstance(); } // constructor
ps.setInt(idx++, caEntry.getKeepExpiredCertInDays()); ps.setString(idx++, caEntry.getValidityMode().name()); ConfPairs extraControl = caEntry.getExtraControl(); String encodedExtraCtrl = (extraControl == null) ? null : extraControl.getEncoded(); ps.setString(idx++, StringUtil.isBlank(encodedExtraCtrl) ? null : encodedExtraCtrl);
private boolean startCa(String caName) { CaInfo caEntry = caInfos.get(caName); ConfPairs extraControl = caEntry.getCaEntry().getExtraControl(); if (extraControl != null) { String str = extraControl.value(RevokeSuspendedCertsControl.KEY_REVOCATION_ENABLED);
ciJaxb.setDuplicateSubject(entry.isDuplicateSubjectPermitted()); ciJaxb.setExpirationPeriod(entry.getExpirationPeriod()); if (entry.getExtraControl() != null) { ciJaxb.setExtraControl(entry.getExtraControl().asMap());
result = SelfSignedCertBuilder.generateSelfSigned(securityFactory, signerType, caEntry.getSignerConf(), certprofile, csr, serialOfThisCert, caEntry.getCaUris(), caEntry.getExtraControl()); } catch (OperationException | InvalidConfException ex) { throw new CaMgmtException(concat(ex.getClass().getName(), ": ", ex.getMessage()), ex); entry.setDuplicateKeyPermitted(caEntry.isDuplicateKeyPermitted()); entry.setDuplicateSubjectPermitted(caEntry.isDuplicateSubjectPermitted()); entry.setExtraControl(caEntry.getExtraControl()); entry.setKeepExpiredCertInDays(caEntry.getKeepExpiredCertInDays()); entry.setMaxValidity(caEntry.getMaxValidity());
keepExpiredCertInDays = caEntry.getKeepExpiredCertInDays(); if (caEntry.getExtraControl() != null) { extraControl = caEntry.getExtraControl().getEncoded();