Home / Class/ SelfSignedCertificate Class — netty Architecture

SelfSignedCertificate Class — netty Architecture

Architecture documentation for the SelfSignedCertificate class in SelfSignedCertificate.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  3f71414d_6bbb_ccc1_3eec_bdf61bb53618["SelfSignedCertificate"]
  fe09b2ae_3eaa_66f9_4e2d_72d815d788a2["SelfSignedCertificate.java"]
  3f71414d_6bbb_ccc1_3eec_bdf61bb53618 -->|defined in| fe09b2ae_3eaa_66f9_4e2d_72d815d788a2
  270a4e53_116c_c0dd_b358_bbdc1b1eff19["SelfSignedCertificate()"]
  3f71414d_6bbb_ccc1_3eec_bdf61bb53618 -->|method| 270a4e53_116c_c0dd_b358_bbdc1b1eff19
  b1603601_1575_eb98_49ba_949eaa17dd88["Builder()"]
  3f71414d_6bbb_ccc1_3eec_bdf61bb53618 -->|method| b1603601_1575_eb98_49ba_949eaa17dd88
  5d39e09b_0acd_9e33_0598_aa663b28daf2["File()"]
  3f71414d_6bbb_ccc1_3eec_bdf61bb53618 -->|method| 5d39e09b_0acd_9e33_0598_aa663b28daf2
  2ea3a1f7_3686_1646_7e47_71976a21280e["X509Certificate()"]
  3f71414d_6bbb_ccc1_3eec_bdf61bb53618 -->|method| 2ea3a1f7_3686_1646_7e47_71976a21280e
  4099ba68_d9cc_a217_7490_c3336342ee48["PrivateKey()"]
  3f71414d_6bbb_ccc1_3eec_bdf61bb53618 -->|method| 4099ba68_d9cc_a217_7490_c3336342ee48
  ef0c7876_0567_5712_b6ac_a49a1c19e8b8["delete()"]
  3f71414d_6bbb_ccc1_3eec_bdf61bb53618 -->|method| ef0c7876_0567_5712_b6ac_a49a1c19e8b8
  3e521991_ebab_34c6_6bc0_ff49eab101aa["newSelfSignedCertificate()"]
  3f71414d_6bbb_ccc1_3eec_bdf61bb53618 -->|method| 3e521991_ebab_34c6_6bc0_ff49eab101aa
  c38a1d9f_c49f_d3d0_cf58_d5aa3ad6dac6["safeDelete()"]
  3f71414d_6bbb_ccc1_3eec_bdf61bb53618 -->|method| c38a1d9f_c49f_d3d0_cf58_d5aa3ad6dac6
  b6d34d94_3591_0c0e_1e18_5c1881831df7["safeClose()"]
  3f71414d_6bbb_ccc1_3eec_bdf61bb53618 -->|method| b6d34d94_3591_0c0e_1e18_5c1881831df7
  f05a46fc_04e8_9057_f98f_584536bb9462["isBouncyCastleAvailable()"]
  3f71414d_6bbb_ccc1_3eec_bdf61bb53618 -->|method| f05a46fc_04e8_9057_f98f_584536bb9462

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/ssl/util/SelfSignedCertificate.java lines 62–592

@Deprecated
public final class SelfSignedCertificate {

    private static final InternalLogger logger = InternalLoggerFactory.getInstance(SelfSignedCertificate.class);

    /** Current time minus 1 year, just in case software clock goes back due to time synchronization */
    private static final Date DEFAULT_NOT_BEFORE = new Date(SystemPropertyUtil.getLong(
            "io.netty.selfSignedCertificate.defaultNotBefore", System.currentTimeMillis() - 86400000L * 365));
    /** The maximum possible value in X.509 specification: 9999-12-31 23:59:59 */
    private static final Date DEFAULT_NOT_AFTER = new Date(SystemPropertyUtil.getLong(
            "io.netty.selfSignedCertificate.defaultNotAfter", 253402300799000L));

    /**
     * FIPS 140-2 encryption requires the RSA key length to be 2048 bits or greater.
     * Let's use that as a sane default but allow the default to be set dynamically
     * for those that need more stringent security requirements.
     */
    private static final int DEFAULT_KEY_LENGTH_BITS =
            SystemPropertyUtil.getInt("io.netty.handler.ssl.util.selfSignedKeyStrength", 2048);

    private final File certificate;
    private final File privateKey;
    private final X509Certificate cert;
    private final PrivateKey key;

    /**
     * Creates a new instance.
     * <p> Algorithm: RSA </p>
     */
    public SelfSignedCertificate() throws CertificateException {
        this(new Builder());
    }

    /**
     * Creates a new instance.
     * <p> Algorithm: RSA </p>
     *
     * @param notBefore Certificate is not valid before this time
     * @param notAfter  Certificate is not valid after this time
     */
    public SelfSignedCertificate(Date notBefore, Date notAfter)
            throws CertificateException {
        this(new Builder().notBefore(notBefore).notAfter(notAfter));
    }

    /**
     * Creates a new instance.
     *
     * @param notBefore Certificate is not valid before this time
     * @param notAfter  Certificate is not valid after this time
     * @param algorithm Key pair algorithm
     * @param bits      the number of bits of the generated private key
     */
    public SelfSignedCertificate(Date notBefore, Date notAfter, String algorithm, int bits)
            throws CertificateException {
        this(new Builder().notBefore(notBefore).notAfter(notAfter).algorithm(algorithm).bits(bits));
    }

    /**
     * Creates a new instance.
     * <p> Algorithm: RSA </p>
     *
     * @param fqdn a fully qualified domain name
     */
    public SelfSignedCertificate(String fqdn) throws CertificateException {
        this(new Builder().fqdn(fqdn));
    }

    /**
     * Creates a new instance.
     *
     * @param fqdn      a fully qualified domain name
     * @param algorithm Key pair algorithm
     * @param bits      the number of bits of the generated private key
     */
    public SelfSignedCertificate(String fqdn, String algorithm, int bits) throws CertificateException {
        this(new Builder().fqdn(fqdn).algorithm(algorithm).bits(bits));
    }

    /**
     * Creates a new instance.

Frequently Asked Questions

What is the SelfSignedCertificate class?
SelfSignedCertificate is a class in the netty codebase, defined in handler/src/main/java/io/netty/handler/ssl/util/SelfSignedCertificate.java.
Where is SelfSignedCertificate defined?
SelfSignedCertificate is defined in handler/src/main/java/io/netty/handler/ssl/util/SelfSignedCertificate.java at line 62.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free