public class IdentityStore extends CertificateStore
configuration, PROVIDER, store
Constructor and Description |
---|
IdentityStore(CertificateStoreConfiguration configuration,
boolean createIfAbsent) |
Modifier and Type | Method and Description |
---|---|
void |
addSelfSignedDomainCertificate()
Populates the key store with a self-signed certificate for the domain of this XMPP service.
|
void |
addSelfSignedDomainCertificate(String algorithm)
Deprecated.
Unused as of Openfire 4.3.0. Use 'addSelfSignedDomainCertificate' instead. See OF-1599.
|
boolean |
containsAllIdentityCertificate()
Checks if the store contains a certificate of a particular algorithm that contains at least all of the identities
of this server (which includes the XMPP domain name, but also its hostname, and XMPP addresses of components
that are currently being hosted).
|
boolean |
containsAllIdentityCertificate(String algorithm)
Deprecated.
Unused as of Openfire 4.3.0. Use 'containsAllIdentityCertificate' instead. See OF-1599.
|
boolean |
containsDomainCertificate()
Checks if the store contains a certificate of a particular algorithm that matches the domain of this
XMPP service.
|
boolean |
containsDomainCertificate(String algorithm)
Deprecated.
Unused as of Openfire 4.3.0. Use 'containsDomainCertificate' instead. See OF-1599.
|
protected boolean |
corresponds(String alias,
List<X509Certificate> certificates) |
void |
ensureDomainCertificate()
Adds a self-signed certificate for the domain of this XMPP service when no certificate for the domain was found.
|
void |
ensureDomainCertificates(String... algorithms)
Deprecated.
Unused as of Openfire 4.3.0. Use 'ensureDomainCertificate' instead. See OF-1599.
|
String |
generateCSR(String alias)
Creates a Certificate Signing Request based on the private key and certificate identified by the provided alias.
|
protected static KeyPair |
generateKeyPair(String algorithm,
int keySize)
Returns a new public & private key with the specified algorithm (e.g.
|
protected String |
generateUniqueAlias()
Generates an alias that is currently unused in this store.
|
String |
installCertificate(String pemCertificates,
String pemPrivateKey,
String passPhrase)
Imports a certificate and the private key that was used to generate the certificate.
|
void |
installCertificate(String alias,
String pemCertificates,
String pemPrivateKey,
String passPhrase)
Imports a certificate and the private key that was used to generate the certificate.
|
void |
installCSRReply(String alias,
String pemCertificates)
Imports a certificate (and its chain) in this store.
|
static boolean |
isForThisDomain(X509Certificate certificate)
Verifies that the subject of the certificate matches the domain of this XMPP service.
|
protected void |
removeAllDomainEntries()
Removes all entries that reflect the local domain.
|
String |
replaceCertificate(String pemCertificates,
String pemPrivateKey,
String passPhrase)
Imports a certificate and the private key that was used to generate the certificate, replacing any previously
installed entries for the same domain.
|
backup, delete, getAllCertificates, getConfiguration, getStore, persist, reload
public IdentityStore(CertificateStoreConfiguration configuration, boolean createIfAbsent) throws CertificateStoreConfigException
CertificateStoreConfigException
public String generateCSR(String alias) throws CertificateStoreConfigException
alias
- An identifier for a private key / certificate in this store (cannot be null).CertificateStoreConfigException
public void installCSRReply(String alias, String pemCertificates) throws CertificateStoreConfigException
pemCertificates
- a PEM representation of the certificate or certificate chain (cannot be null or empty).CertificateStoreConfigException
protected boolean corresponds(String alias, List<X509Certificate> certificates) throws KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException
public String replaceCertificate(String pemCertificates, String pemPrivateKey, String passPhrase) throws CertificateStoreConfigException
pemCertificates
- a PEM representation of the certificate or certificate chain (cannot be null or empty).pemPrivateKey
- a PEM representation of the private key (cannot be null or empty).passPhrase
- optional pass phrase (must be present if the private key is encrypted).CertificateStoreConfigException
public String installCertificate(String pemCertificates, String pemPrivateKey, String passPhrase) throws CertificateStoreConfigException
pemCertificates
- a PEM representation of the certificate or certificate chain (cannot be null or empty).pemPrivateKey
- a PEM representation of the private key (cannot be null or empty).passPhrase
- optional pass phrase (must be present if the private key is encrypted).CertificateStoreConfigException
public void installCertificate(String alias, String pemCertificates, String pemPrivateKey, String passPhrase) throws CertificateStoreConfigException
alias
- the name (key) under which the certificate is to be stored in the store (cannot be null or empty).pemCertificates
- a PEM representation of the certificate or certificate chain (cannot be null or empty).pemPrivateKey
- a PEM representation of the private key (cannot be null or empty).passPhrase
- optional pass phrase (must be present if the private key is encrypted).CertificateStoreConfigException
public void ensureDomainCertificate() throws CertificateStoreConfigException
CertificateStoreConfigException
@Deprecated public void ensureDomainCertificates(String... algorithms) throws CertificateStoreConfigException
for ( String algorithm : algorithms ) { if ( !containsDomainCertificate( algorithm ) ) { addSelfSignedDomainCertificate( algorithm ); } }
algorithms
- The algorithms for which to verify / add a domain certificate.CertificateStoreConfigException
public boolean containsDomainCertificate() throws CertificateStoreConfigException
CertificateStoreConfigException
@Deprecated public boolean containsDomainCertificate(String algorithm) throws CertificateStoreConfigException
algorithm
- An optional algorithm constraint (eg: "RSA"). Can be null, cannot be empty.CertificateStoreConfigException
public boolean containsAllIdentityCertificate() throws CertificateStoreConfigException
CertificateStoreConfigException
@Deprecated public boolean containsAllIdentityCertificate(String algorithm) throws CertificateStoreConfigException
algorithm
- An optional algorithm constraint (eg: "RSA"). Can be null, cannot be empty.CertificateStoreConfigException
public void addSelfSignedDomainCertificate() throws CertificateStoreConfigException
CertificateStoreConfigException
@Deprecated public void addSelfSignedDomainCertificate(String algorithm) throws CertificateStoreConfigException
algorithm
- An optional algorithm constraint (eg: "RSA"). Can be null, cannot be empty.CertificateStoreConfigException
protected static KeyPair generateKeyPair(String algorithm, int keySize) throws GeneralSecurityException
algorithm
- DSA, RSA, etc.keySize
- the desired key size. This is an algorithm-specific metric, such as modulus length, specified in number of bits.GeneralSecurityException
public static boolean isForThisDomain(X509Certificate certificate)
certificate
- The certificate to verify (cannot be null)protected String generateUniqueAlias() throws CertificateStoreConfigException
CertificateStoreConfigException
protected void removeAllDomainEntries() throws KeyStoreException
KeyStoreException
Copyright © 2003–2019 Ignite Realtime. All rights reserved.