public static CertRevocationInfo fromEncoded(String encoded) { ConfPairs pairs = new ConfPairs(encoded); CrlReason reason = CrlReason.forNameOrText(pairs.value("reason")); Date revocationTime = new Date(1000L * Long.parseLong(pairs.value("revocationTime"))); String str = pairs.value("invalidityTime"); Date invalidityTime = null; if (str != null) { invalidityTime = new Date(1000L * Long.parseLong(pairs.value("invalidityTime"))); } return new CertRevocationInfo(reason, revocationTime, invalidityTime); }
@Override protected Object execute0() throws Exception { CrlReason crlReason = CrlReason.forNameOrText(reason); if (!CrlReason.PERMITTED_CLIENT_CRLREASONS.contains(crlReason)) { throw new InvalidConfException("reason " + reason + " is not permitted"); } Date invalidityDate = null; if (isNotBlank(invalidityDateS)) { invalidityDate = DateUtil.parseUtcTimeyyyyMMddhhmmss(invalidityDateS); } boolean successful = caManager.revokeCertificate(caName, getSerialNumber(), crlReason, invalidityDate); output(successful, "revoked", "could not revoke", "certificate"); return null; }
@Override protected Object execute0() throws Exception { CrlReason crlReason = CrlReason.forNameOrText(reason); if (!CrlReason.PERMITTED_CLIENT_CRLREASONS.contains(crlReason)) { throw new InvalidConfException("reason " + reason + " is not permitted"); } Date invalidityDate = null; if (isNotBlank(invalidityDateS)) { invalidityDate = DateUtil.parseUtcTimeyyyyMMddhhmmss(invalidityDateS); } BigInteger serialNo = getSerialNumber(); String msg = "certificate (serial number = 0x" + serialNo.toString(16) + ")"; try { caManager.revokeCertificate(caName, serialNo, crlReason, invalidityDate); println("revoked " + msg); return null; } catch (CaMgmtException ex) { throw new CmdFailure("could not revoke " + msg + ", error: " + ex.getMessage(), ex); } }
@Override protected Object execute0() throws Exception { CrlReason crlReason = CrlReason.forNameOrText(reason); if (!PERMITTED_REASONS.contains(crlReason)) { throw new IllegalCmdParamException("reason " + reason + " is not permitted"); } if (!caManager.getCaNames().contains(caName)) { throw new IllegalCmdParamException("invalid CA name " + caName); } Date revocationDate = null; revocationDate = isNotBlank(revocationDateS) ? DateUtil.parseUtcTimeyyyyMMddhhmmss(revocationDateS) : new Date(); Date invalidityDate = null; if (isNotBlank(invalidityDateS)) { invalidityDate = DateUtil.parseUtcTimeyyyyMMddhhmmss(invalidityDateS); } CertRevocationInfo revInfo = new CertRevocationInfo(crlReason, revocationDate, invalidityDate); boolean bo = caManager.revokeCa(caName, revInfo); output(bo, "revoked", "could not revoke", "CA " + caName); return null; } // method execute0
@Override protected Object execute0() throws Exception { CrlReason crlReason = CrlReason.forNameOrText(reason); if (!PERMITTED_REASONS.contains(crlReason)) { throw new IllegalCmdParamException("reason " + reason + " is not permitted"); } if (!caManager.getCaNames().contains(caName)) { throw new IllegalCmdParamException("invalid CA name " + caName); } Date revocationDate = null; revocationDate = isNotBlank(revocationDateS) ? DateUtil.parseUtcTimeyyyyMMddhhmmss(revocationDateS) : new Date(); Date invalidityDate = null; if (isNotBlank(invalidityDateS)) { invalidityDate = DateUtil.parseUtcTimeyyyyMMddhhmmss(invalidityDateS); } CertRevocationInfo revInfo = new CertRevocationInfo(crlReason, revocationDate, invalidityDate); String msg = "CA " + caName; try { caManager.revokeCa(caName, revInfo); println("revoked " + msg); return null; } catch (CaMgmtException ex) { throw new CmdFailure("could not revoke " + msg + ", error: " + ex.getMessage(), ex); } } // method execute0
str = extraControl.value(RevokeSuspendedCertsControl.KEY_REVOCATION_REASON); CrlReason reason = (str == null) ? CrlReason.CESSATION_OF_OPERATION : CrlReason.forNameOrText(str);
String strReason = httpRetriever.getParameter(RestAPIConstants.PARAM_reason); CrlReason reason = (strReason == null) ? CrlReason.UNSPECIFIED : CrlReason.forNameOrText(strReason);