Skip to content

The Self-Signed Certificate Generator is a Java application that allows you to generate a self-signed X.509 certificate and corresponding private key using the Java security API and Bouncy Castle provider. This is useful for testing and development purposes when you need to create a self-signed certificate for SSL.

Notifications You must be signed in to change notification settings

Codes-Lab/SelfSignedCertificateGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Self-Signed Certificate Generator

The Self-Signed Certificate Generator is a Java application that allows you to generate a self-signed X.509 certificate and corresponding private key using the Java security API and Bouncy Castle provider. This is useful for testing and development purposes when you need to create a self-signed certificate for SSL/TLS encryption.

Prerequisites

  • Java Development Kit (JDK) 8 or higher
  • Bouncy Castle Provider Library (bcprov-jdk15on-1.69.jar)

Usage

  1. Download and install the Java Development Kit (JDK) if you don't have it already.
  2. Download the Bouncy Castle Provider Library (bcprov-jdk15on-1.69.jar) from the Bouncy Castle website and add it to your classpath.
  3. Compile the Java source file SelfSignedCertificateGenerator.java:
    javac SelfSignedCertificateGenerator.java
  4. Run the SelfSignedCertificateGenerator class to generate the self-signed certificate and private key:
    java SelfSignedCertificateGenerator
  5. The application will generate a self-signed X.509 certificate (certificate.cert) and the corresponding private key (key.pem) in the current directory.

Configuration

Modify the following parameters in the SelfSignedCertificateGenerator class if needed:

  • keySize: The key size used for generating the RSA key pair. The default is 2048 bits.
  • validityDays: The number of days the generated certificate will be valid. The default is 365 days.
  • certificateFileName: The name of the output file for the generated certificate. The default is certificate.cert.
  • privateKeyFileName: The name of the output file for the generated private key. The default is key.pem.

Important Note

The self-signed certificate generated by this tool is not issued by a trusted certificate authority (CA) and should not be used in a production environment. It is intended for testing and development purposes only.

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.

Acknowledgments

This application utilizes the Bouncy Castle cryptographic library for generating the self-signed certificate.

Disclaimer

This tool is provided as-is without any warranty. Use it at your own risk.

Feel free to customize and enhance the README file based on your specific requirements and project details.

About

The Self-Signed Certificate Generator is a Java application that allows you to generate a self-signed X.509 certificate and corresponding private key using the Java security API and Bouncy Castle provider. This is useful for testing and development purposes when you need to create a self-signed certificate for SSL.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages