public final class TlsKeyGenerator
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
ALGORITHM |
private static java.lang.String |
BASE_DN |
static java.lang.String |
CERTIFICATE_PRINCIPAL_DN |
static java.lang.String |
KEY_ALGORITHM_AT |
private static int |
KEY_SIZE |
private static org.slf4j.Logger |
LOG |
static java.lang.String |
PRIVATE_KEY_AT |
static java.lang.String |
PRIVATE_KEY_FORMAT_AT |
static java.lang.String |
PUBLIC_KEY_AT |
static java.lang.String |
PUBLIC_KEY_FORMAT_AT |
static java.lang.String |
TLS_KEY_INFO_OC |
static java.lang.String |
USER_CERTIFICATE_AT |
private static long |
YEAR_MILLIS |
| Modifier | Constructor and Description |
|---|---|
private |
TlsKeyGenerator() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addKeyPair(org.apache.directory.api.ldap.model.entry.Entry entry)
Adds a private key pair along with a self signed certificate to an
entry making sure it contains the objectClasses and attributes needed
to support the additions.
|
static void |
addKeyPair(org.apache.directory.api.ldap.model.entry.Entry entry,
java.lang.String issuerDN,
java.lang.String subjectDN,
java.lang.String keyAlgo) |
static java.security.cert.X509Certificate |
getCertificate(org.apache.directory.api.ldap.model.entry.Entry entry)
Gets the certificate associated with the self signed TLS private/public
key pair.
|
static java.security.KeyPair |
getKeyPair(org.apache.directory.api.ldap.model.entry.Entry entry)
Extracts the public private key pair from the tlsKeyInfo entry.
|
private static final org.slf4j.Logger LOG
public static final java.lang.String TLS_KEY_INFO_OC
public static final java.lang.String PRIVATE_KEY_AT
public static final java.lang.String PUBLIC_KEY_AT
public static final java.lang.String KEY_ALGORITHM_AT
public static final java.lang.String PRIVATE_KEY_FORMAT_AT
public static final java.lang.String PUBLIC_KEY_FORMAT_AT
public static final java.lang.String USER_CERTIFICATE_AT
private static final java.lang.String BASE_DN
public static final java.lang.String CERTIFICATE_PRINCIPAL_DN
private static final java.lang.String ALGORITHM
private static final int KEY_SIZE
private static final long YEAR_MILLIS
public static java.security.cert.X509Certificate getCertificate(org.apache.directory.api.ldap.model.entry.Entry entry)
throws org.apache.directory.api.ldap.model.exception.LdapException
entry - the TLS key/cert entryorg.apache.directory.api.ldap.model.exception.LdapException - if there are problems accessing or decodingpublic static java.security.KeyPair getKeyPair(org.apache.directory.api.ldap.model.entry.Entry entry)
throws org.apache.directory.api.ldap.model.exception.LdapException
entry - an entry of the tlsKeyInfo objectClassorg.apache.directory.api.ldap.model.exception.LdapException - if there are format or access issuespublic static void addKeyPair(org.apache.directory.api.ldap.model.entry.Entry entry)
throws org.apache.directory.api.ldap.model.exception.LdapException
entry - the entry to add security attributes toorg.apache.directory.api.ldap.model.exception.LdapException - on problems generating the content in the entrypublic static void addKeyPair(org.apache.directory.api.ldap.model.entry.Entry entry,
java.lang.String issuerDN,
java.lang.String subjectDN,
java.lang.String keyAlgo)
throws org.apache.directory.api.ldap.model.exception.LdapException
org.apache.directory.api.ldap.model.exception.LdapExceptionTODO the code is duplicate atm, will eliminate this redundancy after finding
a better thought (an instant one is to call this method from the aboveaddKeyPair(entry) and remove the impl there)