@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class CertificateDataReplaceCertificateKeyStoreContent extends ReplaceCertificateKeyStoreContent
ReplaceCertificateKeyStoreContent
implementation to indicate that the certificate chain and private key (in
either PEM or DER format) are provided directly in the extended request.
NOTE: This class, and other classes within the
com.unboundid.ldap.sdk.unboundidds
package structure, are only
supported for use against Ping Identity, UnboundID, and
Nokia/Alcatel-Lucent 8661 server products. These classes provide support
for proprietary functionality or for external specifications that are not
considered stable or mature enough to be guaranteed to work in an
interoperable way with other types of LDAP servers.
Constructor and Description |
---|
CertificateDataReplaceCertificateKeyStoreContent(java.util.List<byte[]> certificateChainData,
byte[] privateKeyData)
Creates a new instance of this key store content object with the provided
information.
|
CertificateDataReplaceCertificateKeyStoreContent(java.util.List<java.io.File> certificateChainFiles,
java.io.File privateKeyFile)
Creates a new instance of this key store content object with the provided
information.
|
CertificateDataReplaceCertificateKeyStoreContent(java.util.List<java.io.File> certificateChainFiles,
java.io.File privateKeyFile,
java.io.File privateKeyEncryptionPasswordFile)
Creates a new instance of this key store content object with the provided
information.
|
Modifier and Type | Method and Description |
---|---|
ASN1Element |
encode()
Encodes this key store content object to an ASN.1 element suitable for
inclusion in either a replace listener certificate or replace inter-server
certificate request.
|
java.util.List<byte[]> |
getCertificateChainData()
Retrieves a list of the DER-formatted or PEM-formatted representations of
the X.509 certificates in the new certificate chain.
|
byte[] |
getPrivateKeyData()
Retrieves the DER-formatted or PEM-formatted PKCS #8 private key for the
new certificate, if available.
|
static java.util.List<byte[]> |
readCertificateChain(java.io.File... files)
Reads a certificate chain from the given file or set of files.
|
static java.util.List<byte[]> |
readCertificateChain(java.util.List<java.io.File> files)
Reads a certificate chain from the given file or set of files.
|
static byte[] |
readPrivateKey(java.io.File file)
Reads a PKCS #8 private key from the given file.
|
static byte[] |
readPrivateKey(java.io.File file,
java.io.File encryptionPasswordFile)
Reads a PKCS #8 private key from the given file.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this key store content object to the
provided buffer.
|
decode, toString
public CertificateDataReplaceCertificateKeyStoreContent(@NotNull java.util.List<byte[]> certificateChainData, @Nullable byte[] privateKeyData)
certificateChainData
- A list containing the encoded representations
of the X.509 certificates in the new
certificate chain. Each byte array must
contain the PEM or DER representation of a
single certificate in the chain, with the
first certificate being the end-entity
certificate, and each subsequent certificate
being the issuer for the previous
certificate. This must not be null
or empty.privateKeyData
- An array containing the encoded
representation of the PKCS #8 private key
for the end-entity certificate in the chain.
It may be encoded in either PEM or DER
format. This may be null
if the
new end-entity certificate uses the same
private key as the certificate currently in
use in the server.public CertificateDataReplaceCertificateKeyStoreContent(@NotNull java.util.List<java.io.File> certificateChainFiles, @Nullable java.io.File privateKeyFile) throws LDAPException
certificateChainFiles
- A list containing one or more files from
which to read the PEM or DER representations
of the X.509 certificates to include in
the new certificate chain. The order of
the files, and the order of the certificates
in each file, should be arranged such that
the first certificate read is the end-entity
certificate and each subsequent certificate
is the issuer for the previous. This must
not be null
or empty.privateKeyFile
- A file from which to read the PEM or DER
representation of the PKCS #8 private key
for the end-entity certificate in the chain.
This may be null
if the new
end-entity certificate uses the same private
key as the certificate currently in use in
the server. The private key must not be
encrypted.LDAPException
- If a problem occurs while trying to read or parse
data contained in any of the provided files.public CertificateDataReplaceCertificateKeyStoreContent(@NotNull java.util.List<java.io.File> certificateChainFiles, @Nullable java.io.File privateKeyFile, @Nullable java.io.File privateKeyEncryptionPasswordFile) throws LDAPException
certificateChainFiles
- A list containing one or more files from which to read the PEM
or DER representations of the X.509 certificates to include in
the new certificate chain. The order of the files, and the
order of the certificates in each file, should be arranged
such that the first certificate read is the end-entity
certificate and each subsequent certificate is the issuer for
the previous. This must not be null
or empty.privateKeyFile
- A file from which to read the PEM or DER representation of the
PKCS #8 private key for the end-entity certificate in the
chain. This may be null
if the new end-entity
certificate uses the same private key as the certificate
currently in use in the server.privateKeyEncryptionPasswordFile
- A file that contains the password needed to decrypt the
private key if it is encrypted. This may be null
if
the private key is not encrypted.LDAPException
- If a problem occurs while trying to read or parse
data contained in any of the provided files.@NotNull public static java.util.List<byte[]> readCertificateChain(@NotNull java.io.File... files) throws LDAPException
files
- The set of files from which the certificate chain should be
read. It must not be null
or empty.LDAPException
- If a problem was encountered while attempting to
read from or parse the content of any of the files.@NotNull public static java.util.List<byte[]> readCertificateChain(@NotNull java.util.List<java.io.File> files) throws LDAPException
files
- The set of files from which the certificate chain should be
read. It must not be null
or empty.LDAPException
- If a problem was encountered while attempting to
read from or parse the content of any of the files.@NotNull public static byte[] readPrivateKey(@NotNull java.io.File file) throws LDAPException
file
- The file from which the private key should be read. It must
not be null
.LDAPException
- If a problem occurs while trying to read from
or parse the content of the specified file.@NotNull public static byte[] readPrivateKey(@NotNull java.io.File file, @Nullable java.io.File encryptionPasswordFile) throws LDAPException
file
- The file from which the private key should
be read. It must not be null
.encryptionPasswordFile
- The file containing the password needed to
decrypt the private key if it is encrypted.
It may be null
if the private key
is not encrypted.LDAPException
- If a problem occurs while trying to read from
or parse the content of the specified file.@NotNull public java.util.List<byte[]> getCertificateChainData()
@Nullable public byte[] getPrivateKeyData()
null
if the new certificate should use the
same private key as the current certificate.@NotNull public ASN1Element encode()
encode
in class ReplaceCertificateKeyStoreContent
public void toString(@NotNull java.lang.StringBuilder buffer)
toString
in class ReplaceCertificateKeyStoreContent
buffer
- The buffer to which the encoded representation should be
appended. It must not be null
.