import org.cacert.gigi.dbObjects.CertificateProfile;
import org.cacert.gigi.dbObjects.Digest;
import org.cacert.gigi.output.DateSelector;
-import org.cacert.gigi.testUtils.IOUtils;
import sun.security.pkcs10.PKCS10;
import sun.security.util.DerOutputStream;
while (rs.next()) {
int id = rs.getInt(1);
File crt = KeyStorage.locateCrt(id);
- String[] call = new String[] {
- "openssl", "ca",//
- "-cert",
- "../unassured.crt",//
- "-keyfile",
- "../unassured.key",//
- "-revoke",
- "../../" + crt.getPath(),//
- "-batch",//
- "-config",
- "../selfsign.config"
-
- };
- Process p1 = Runtime.getRuntime().exec(call, null, new File("keys/unassured.ca"));
- System.out.println("revoking: " + crt.getPath());
- if (p1.waitFor() == 0) {
- worked = true;
- revokeCompleted.setInt(1, id);
- revokeCompleted.execute();
- finishJob.setInt(1, rs.getInt(3));
- finishJob.execute();
- } else {
- System.out.println("Failed");
- }
+ worked = true;
+ revokeCompleted.setInt(1, id);
+ revokeCompleted.execute();
+ finishJob.setInt(1, rs.getInt(3));
+ finishJob.execute();
}
if (worked) {
gencrl();
}
private static void gencrl() throws IOException, InterruptedException {
+ if (true) {
+ return;
+ }
String[] call = new String[] {
"openssl", "ca",//
"-cert",
PublicKey pk;
byte[] data = IOUtils.readURL(new FileInputStream(csrname));
if (ct == CSRType.SPKAC) {
- SPKAC sp = new SPKAC(data);
+ String dt = new String(data);
+ if (dt.startsWith("SPKAC=")) {
+ dt = dt.substring(6);
+ data = dt.getBytes();
+ System.out.println(dt);
+ }
+ SPKAC sp = new SPKAC(Base64.getDecoder().decode(data));
pk = sp.getPubkey();
} else {
PKCS10 p10 = new PKCS10(PEM.decode("(NEW )?CERTIFICATE REQUEST", new String(data)));