public static ResultHolder generateValidCertificate(@Nullable final String subjectCommonName ) throws Exception
    {
        return generateTestCertificate( subjectCommonName, true, false, 0 );
    }
Instantiates a new certificate of which the notBefore value is a point in the past, and the notAfter value is a
point in the future (as compared to the point in time of the invocation of this method).

The notAfter value can be expected to be a value that is far enough in the future for unit testing purposes, but
should not be assumed to be a value that is in the distant future. It is safe to assume that the generated
certificate will remain to be valid for the duration of a generic unit test (which is measured in seconds or
fractions thereof).

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