@Test public void testMint() { RootCertificate root = CA.createSelfSignedCertificate(dn("CN=Root-Test, O=My Org")).build(); assertNotNull(root); CertificateAuthority ca = new CertificateAuthority(root); final CSR csr = createCsr().generateRequest(dn().setCn("test.com") .setL("666:667:668") .setO("World Company") .setOu("IT dep") .setSt("CA") .setC("US") .build()); Certificate certificate = ca.mintNode(csr); assertNotNull(certificate); }
public static RootCertificate mint(DistinguishedName dn, int cardinality, double probabilityByzantine, double faultTolerance, String crlUri) { DnBuilder builder = dn(); decodeDN(dn.getName()).entrySet().stream().filter(e -> !e.getKey().equals("O")).forEach(e -> { addToBuilder(builder, e); }); builder.setOrganizationName(String.format("%s:%.6f:%.6f", cardinality, faultTolerance, probabilityByzantine)); return CA.createSelfSignedCertificate(builder.build()).setCrlUri(crlUri).build(); }
CertificateAuthority { public static RootCertificate mint(DistinguishedName dn, int cardinality, double probabilityByzantine, double faultTolerance, String crlUri) { DnBuilder builder = dn(); decodeDN(dn.getName()).entrySet().stream().filter(e -> !e.getKey().equals("O")).forEach(e -> { addToBuilder(builder, e); }); builder.setOrganizationName(String.format("%s:%.6f:%.6f", cardinality, faultTolerance, probabilityByzantine)); return CA.createSelfSignedCertificate(builder.build()).setCrlUri(crlUri).build(); } }
CertificateAuthority { public static RootCertificate mint(DistinguishedName dn, int cardinality, double probabilityByzantine, double faultTolerance, String crlUri) { DnBuilder builder = dn(); decodeDN(dn.getName()).entrySet().stream().filter(e -> !e.getKey().equals("O")).forEach(e -> { addToBuilder(builder, e); }); builder.setOrganizationName(String.format("%s:%.6f:%.6f", cardinality, faultTolerance, probabilityByzantine)); return CA.createSelfSignedCertificate(builder.build()).setCrlUri(crlUri).build(); } CertificateAuthority(RootCertificate root);  CertificateAuthority(RootCertificate root, TimeBasedGenerator generator); }
CertificateAuthority { public static RootCertificate mint(DistinguishedName dn, int cardinality, double probabilityByzantine, double faultTolerance, String crlUri) { DnBuilder builder = dn(); decodeDN(dn.getName()).entrySet().stream().filter(e -> !e.getKey().equals("O")).forEach(e -> { addToBuilder(builder, e); }); builder.setOrganizationName(String.format("%s:%.6f:%.6f", cardinality, faultTolerance, probabilityByzantine)); return CA.createSelfSignedCertificate(builder.build()).setCrlUri(crlUri).build(); } CertificateAuthority(RootCertificate root);  CertificateAuthority(RootCertificate root, TimeBasedGenerator generator); static Map<String, String> decodeDN(String dn); static RootCertificate mint(DistinguishedName dn, int cardinality, double probabilityByzantine,
            double faultTolerance, String crlUri); X509Certificate getRoot(); Certificate mintNode(CSR request); }
CertificateAuthority { public static RootCertificate mint(DistinguishedName dn, int cardinality, double probabilityByzantine, double faultTolerance, String crlUri) { DnBuilder builder = dn(); decodeDN(dn.getName()).entrySet().stream().filter(e -> !e.getKey().equals("O")).forEach(e -> { addToBuilder(builder, e); }); builder.setOrganizationName(String.format("%s:%.6f:%.6f", cardinality, faultTolerance, probabilityByzantine)); return CA.createSelfSignedCertificate(builder.build()).setCrlUri(crlUri).build(); } CertificateAuthority(RootCertificate root);  CertificateAuthority(RootCertificate root, TimeBasedGenerator generator); static Map<String, String> decodeDN(String dn); static RootCertificate mint(DistinguishedName dn, int cardinality, double probabilityByzantine,
            double faultTolerance, String crlUri); X509Certificate getRoot(); Certificate mintNode(CSR request);  }