use of org.xipki.ca.server.mgmt.api.x509.CertWithStatusInfo in project xipki by xipki.
the class CertStatusCmd method execute0.
@Override
protected Object execute0() throws Exception {
CertWithStatusInfo certInfo = caManager.getCert(caName, getSerialNumber());
X509Certificate cert = (X509Certificate) certInfo.getCert();
if (cert == null) {
System.out.println("certificate unknown");
return null;
}
String msg = StringUtil.concat("certificate profile: ", certInfo.getCertprofile(), "\nstatus: ", (certInfo.getRevocationInfo() == null ? "good" : "revoked with " + certInfo.getRevocationInfo()));
println(msg);
if (outputFile != null) {
saveVerbose("certificate saved to file", new File(outputFile), cert.getEncoded());
}
return null;
}
use of org.xipki.ca.server.mgmt.api.x509.CertWithStatusInfo in project xipki by xipki.
the class GetCertCmd method execute0.
@Override
protected Object execute0() throws Exception {
CertWithStatusInfo certInfo = caManager.getCert(caName, toBigInt(serialNumberS));
X509Certificate cert = (X509Certificate) certInfo.getCert();
if (cert == null) {
System.out.println("certificate unknown");
return null;
}
saveVerbose("certificate saved to file", new File(outputFile), cert.getEncoded());
return null;
}
use of org.xipki.ca.server.mgmt.api.x509.CertWithStatusInfo in project xipki by xipki.
the class CaManagerImpl method getCert.
// method canonicalizeSignerConf
@Override
public CertWithStatusInfo getCert(String caName, BigInteger serialNumber) throws CaMgmtException {
caName = ParamUtil.requireNonBlank("caName", caName).toLowerCase();
ParamUtil.requireNonNull("serialNumber", serialNumber);
X509Ca ca = getX509Ca(caName);
X509CertWithRevocationInfo certInfo;
try {
certInfo = ca.getCertWithRevocationInfo(serialNumber);
} catch (CertificateException | OperationException ex) {
throw new CaMgmtException(ex.getMessage(), ex);
}
return (certInfo != null) ? certInfo.toCertWithStatusInfo() : new CertWithStatusInfo();
}
use of org.xipki.ca.server.mgmt.api.x509.CertWithStatusInfo in project xipki by xipki.
the class X509CertWithRevocationInfo method toCertWithStatusInfo.
public CertWithStatusInfo toCertWithStatusInfo() {
CertWithStatusInfo ret = new CertWithStatusInfo();
ret.setCert(cert.getCert());
ret.setCertprofile(certprofile);
ret.setRevocationInfo(revInfo);
return ret;
}
Aggregations