public String opensslDn() {
        StringBuilder bldr = new StringBuilder();

        if (organizationName != null)   {
            bldr.append(String.format("/O=%s", organizationName));
        }

        if (commonName != null)   {
            bldr.append(String.format("/CN=%s", commonName));
        }

        return bldr.toString();
    }
@Test
    public void testSubjectOpensslDn()   {
        Subject.Builder subject = new Subject.Builder()
            .withCommonName("joe");
        assertThat(subject.build().opensslDn(), is("/CN=joe"));

        subject = new Subject.Builder()
            .withOrganizationName("MyOrg");
        assertThat(subject.build().opensslDn(), is("/O=MyOrg"));

        subject = new Subject.Builder()
            .withCommonName("joe")
            .withOrganizationName("MyOrg");
        assertThat(subject.build().opensslDn(), is("/O=MyOrg/CN=joe"));
    }