]> WPIA git - gigi.git/blobdiff - util-testing/org/cacert/gigi/util/SimpleSigner.java
Merge "upd: Reduce Boilerplate in translated SprintfCommands"
[gigi.git] / util-testing / org / cacert / gigi / util / SimpleSigner.java
index a0c3898369391b0a14bc019326373402f140aa8d..d23b78bc6d83fd1f7a0c8a008183159b7403c882 100644 (file)
@@ -374,7 +374,7 @@ public class SimpleSigner {
         return i;
     }
 
-    private static synchronized byte[] generateCert(PublicKey pk, PrivateKey prk, Map<String, String> subj, X500Principal issuer, List<SubjectAlternateName> altnames, Date fromDate, Date toDate, Digest digest, String eku) throws IOException, GeneralSecurityException {
+    public static synchronized byte[] generateCert(PublicKey pk, PrivateKey prk, Map<String, String> subj, X500Principal issuer, List<SubjectAlternateName> altnames, Date fromDate, Date toDate, Digest digest, String eku) throws IOException, GeneralSecurityException {
         File f = Paths.get("signer", "serial").toFile();
         if ( !f.exists()) {
             try (FileOutputStream fos = new FileOutputStream(f)) {
@@ -494,6 +494,9 @@ public class SimpleSigner {
             case "emailProtection":
                 oid = new ObjectIdentifier("1.3.6.1.5.5.7.3.4");
                 break;
+            case "OCSPSigning":
+                oid = new ObjectIdentifier("1.3.6.1.5.5.7.3.9");
+                break;
 
             default:
                 throw new Error(name);
@@ -506,7 +509,7 @@ public class SimpleSigner {
         return dos.toByteArray();
     }
 
-    private static X500Name genX500Name(Map<String, String> subj) throws IOException {
+    public static X500Name genX500Name(Map<String, String> subj) throws IOException {
         LinkedList<RDN> rdns = new LinkedList<>();
         for (Entry<String, String> i : subj.entrySet()) {
             RDN rdn = genRDN(i);