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

TLS

class TLS (source)

Common utilities for TLS.

This class depends upon the BouncyCastle library being available and added as a java.security.Provider. See https://www.bouncycastle.org/wiki/display/JA1/Provider+Installation.

BouncyCastle can be included using the gradle dependencies org.bouncycastle:bcprov-jdk15on and org.bouncycastle:bcpkix-jdk15on.

Functions

certificateFingerprint

Calculate the fingerprint for a PEM-encoded certificate.

static fun certificateFingerprint(certificate: Path!): ByteArray!

Calculate the fingerprint for certificate.

static fun certificateFingerprint(certificate: Certificate!): ByteArray!

certificateHexFingerprint

Calculate the fingerprint for a PEM-encoded certificate.

static fun certificateHexFingerprint(certificate: Path!): String!

Calculate the fingerprint for certificate.

static fun certificateHexFingerprint(certificate: Certificate!): String!

createSelfSignedCertificateIfMissing

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

static fun createSelfSignedCertificateIfMissing(key: Path!, certificate: Path!): Boolean
static fun createSelfSignedCertificateIfMissing(key: Path!, certificate: Path!, commonName: String!): Boolean

readPemFile

Read a PEM-encoded file.

static fun readPemFile(certificate: Path!): ByteArray!