public static ResultHolder generateSelfSignedCertificate(@Nullable final String subjectCommonName ) throws Exception
    {
        return generateTestCertificate( subjectCommonName, true, true, 0 );
    }
Instantiates a new certificate that is self-signed, meaning that the issuer and subject values are identical. The
returned certificate is valid in the same manner as described in the documentation of
{@link #generateValidCertificate()}.

@param subjectCommonName The CN value to use in the certificate.
@return A certificate that is self-signed (never null).
@see #generateValidCertificate()
xmppserver/src/test/java/org/jivesoftware/openfire/keystore/KeystoreTestUtils.java