Top Fields Constructors Methods
org.eclipse.jetty.quic.quiche

public Class PemExporter

extends Object
Class Inheritance
Imports
java.io.IOException, .OutputStream, java.nio.charset.StandardCharsets, java.nio.file.Files, .Path, java.nio.file.attribute.PosixFilePermission, java.security.Key, .KeyStore, java.security.cert.Certificate, .CertificateEncodingException, java.util.Base64, .Enumeration, .Set, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private static final byte[]
private static final byte[]
private static final Base64.Encoder
private static final byte[]
private static final byte[]
private static final byte[]
private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Path[]
exportKeyPair(KeyStore keyStore, String alias, char[] keyPassword, Path targetFolder)

Returns: [0] is the key file, [1] is the cert file.

public static Path
exportTrustStore(KeyStore keyStore, Path targetFolder)

Returns: a temp file that gets deleted on exit

private static void
writeAsPEM(OutputStream outputStream, Key key)

private static void
writeAsPEM(OutputStream outputStream, Certificate certificate)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BEGIN_CERTback to summary
private static final byte[] BEGIN_CERT
BEGIN_KEYback to summary
private static final byte[] BEGIN_KEY
ENCODERback to summary
private static final Base64.Encoder ENCODER
END_CERTback to summary
private static final byte[] END_CERT
END_KEYback to summary
private static final byte[] END_KEY
LINE_SEPARATORback to summary
private static final byte[] LINE_SEPARATOR
LOGback to summary
private static final Logger LOG

Constructor Detail

PemExporterback to summary
private PemExporter()

Method Detail

exportKeyPairback to summary
public static Path[] exportKeyPair(KeyStore keyStore, String alias, char[] keyPassword, Path targetFolder) throws Exception
Returns:Path[]

[0] is the key file, [1] is the cert file.

exportTrustStoreback to summary
public static Path exportTrustStore(KeyStore keyStore, Path targetFolder) throws Exception
Returns:Path

a temp file that gets deleted on exit

writeAsPEMback to summary
private static void writeAsPEM(OutputStream outputStream, Key key) throws IOException
writeAsPEMback to summary
private static void writeAsPEM(OutputStream outputStream, Certificate certificate) throws CertificateEncodingException, IOException