net / org.apache.tuweni.net.tls / TLS / createSelfSignedCertificateIfMissing

createSelfSignedCertificateIfMissing

static fun createSelfSignedCertificateIfMissing(key: Path, certificate: Path): Boolean (source)

Create a self-signed certificate, if it is not already present.

If both the key or the certificate file are missing, they will be re-created as a self-signed certificate.

Parameters

key - The key path.

certificate - The certificate path.

Exceptions

IOException - If an IO error occurs creating the certificate.

Return
true if a self-signed certificate was created.