public class SelfSignedCertificateGenerator extends Object
Usage on Java 11+:
java --add-exports java.base/sun.security.x509=ALL-UNNAMED -cp davmail.jar davmail.DavGateway -generateCertOn Java 8, the --add-exports flag is not needed.
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_KEYSTORE_PASSWORD |
| Modifier and Type | Method and Description |
|---|---|
static void |
generate(String configFilePath)
Generate a self-signed certificate, save it next to the DavMail settings file,
and update settings with the keystore configuration.
|
static void |
generateAndSave(String keystoreFilename,
String keystorePassword)
Generate a self-signed PKCS12 keystore file.
|
static String |
resolveKeystorePath(String configFilePath)
Resolve keystore path: place davmail.p12 next to the given config file.
|
public static final String DEFAULT_KEYSTORE_PASSWORD
public static String resolveKeystorePath(String configFilePath)
configFilePath - path to the DavMail properties filepublic static void generate(String configFilePath)
DavGateway with -generateCert option.configFilePath - path to the DavMail properties filepublic static void generateAndSave(String keystoreFilename, String keystorePassword) throws GeneralSecurityException, IOException
keystoreFilename - output filename (e.g., "davmail.p12")keystorePassword - password for the keystore and key entryGeneralSecurityException - if certificate generation failsIOException - if keystore file cannot be writtenCopyright © 2001–2026 MickaĆ«l Guessant. All rights reserved.