public final class CertificateUtils extends Object
Requires Bouncy Castle
. This class is part of the acme4j-utils
module.
Modifier and Type | Method and Description |
---|---|
static org.bouncycastle.pkcs.PKCS10CertificationRequest |
readCSR(InputStream in)
Reads a CSR PEM file.
|
static X509Certificate |
readX509Certificate(InputStream in)
Reads an
X509Certificate PEM file from an InputStream . |
static void |
writeX509Certificate(X509Certificate cert,
OutputStream out)
Writes an X.509 certificate PEM file.
|
static void |
writeX509Certificate(X509Certificate cert,
Writer w)
Writes an X.509 certificate PEM file.
|
static void |
writeX509CertificateChain(Writer w,
X509Certificate cert,
X509Certificate... chain)
Deprecated.
|
static void |
writeX509Certificates(Writer w,
X509Certificate... certs)
Writes multiple X.509 certificates to a PEM file.
|
public static X509Certificate readX509Certificate(InputStream in) throws IOException
X509Certificate
PEM file from an InputStream
.in
- InputStream
to read the certificate from. The
InputStream
is closed after use.X509Certificate
that was readIOException
public static void writeX509Certificate(X509Certificate cert, OutputStream out) throws IOException
cert
- X509Certificate
to writeout
- OutputStream
to write the PEM file to. The OutputStream
is closed after use.IOException
public static void writeX509Certificate(X509Certificate cert, Writer w) throws IOException
cert
- X509Certificate
to writew
- Writer
to write the PEM file to. The Writer
is closed
after use.IOException
@Deprecated public static void writeX509CertificateChain(Writer w, X509Certificate cert, X509Certificate... chain) throws IOException
Certificate.downloadFullChain()
and
writeX509Certificates(Writer, X509Certificate[])
insteadw
- Writer
to write the certificate chain to. The Writer
is
closed after use.cert
- X509Certificate
to write, null
to skip this certificatechain
- X509Certificate
chain to add to the certificate. null
values are ignored, array may be empty.IOException
public static void writeX509Certificates(Writer w, X509Certificate... certs) throws IOException
w
- Writer
to write the certificate chain to. The Writer
is
closed after use.certs
- X509Certificate
certificates to add to the certificate.
null
values are ignored, array may be empty.IOException
public static org.bouncycastle.pkcs.PKCS10CertificationRequest readCSR(InputStream in) throws IOException
in
- InputStream
to read the CSR from. The InputStream
is
closed after use.IOException
Copyright © 2015–2019. All rights reserved.