@Bean(name="certificate-container", parent=Kernel.class, active=true, exportable=true) public class CertificateContainer extends Object implements CertificateContainerIfc, Initializable, UnregisterAware
| Modifier and Type | Class and Description |
|---|---|
static class |
CertificateContainer.CertificateChange |
class |
CertificateContainer.CertificateChanged |
| Modifier and Type | Field and Description |
|---|---|
static String |
PER_DOMAIN_CERTIFICATE_KEY |
static String |
SNI_DISABLE_KEY |
CERTIFICATE_CONTAINER_CLASS_KEY, CERTIFICATE_CONTAINER_CLASS_VAL| Constructor and Description |
|---|
CertificateContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCertificates(Map<String,String> params)
Method
addCertificates allows to add more certificates at run time after the container has bee
already initialized. |
void |
beforeUnregister()
Method called before bean unregister.
|
void |
certificateChange(CertificateContainer.CertificateChange event) |
KeyManager[] |
createCertificate(String alias)
Method
createCertificate allows to generate self-signed certificate for passed domain name.s |
CertificateEntry |
getCertificateEntry(String hostname) |
String |
getDefCertAlias()
Method to retrieve default alias of certificate to use when domain is
null |
KeyManager[] |
getKeyManagers(String hostname)
Method returns array of
KeyManager with certificate for domain or null if there is no
certificate for domain |
TrustManager[] |
getTrustManagers() |
KeyStore |
getTrustStore() |
void |
init(Map<String,Object> params)
Method used to pass parameters to initialize instance of class
|
void |
initialize()
Method will be called, when bean will be created, configured and ready to use.
|
public static final String PER_DOMAIN_CERTIFICATE_KEY
public static final String SNI_DISABLE_KEY
public void addCertificates(Map<String,String> params) throws CertificateParsingException
CertificateContainerIfcaddCertificates allows to add more certificates at run time after the container has bee
already initialized. This is to avoid server restart if there are certificates updates or new certificates for
new virtual domain. The method should add new certificates or replace existing one if there is already a
certificate for a domain.addCertificates in interface CertificateContainerIfcparams - a Map value with configuration parameters.CertificateParsingExceptionpublic KeyManager[] createCertificate(String alias) throws NoSuchAlgorithmException, CertificateException, SignatureException, NoSuchProviderException, InvalidKeyException, IOException, UnrecoverableKeyException, KeyStoreException
CertificateContainerIfccreateCertificate allows to generate self-signed certificate for passed domain name.screateCertificate in interface CertificateContainerIfcalias - domain for which certificate should be generatedKeyManager containing generated certificateNoSuchAlgorithmExceptionCertificateExceptionSignatureExceptionNoSuchProviderExceptionInvalidKeyExceptionIOExceptionUnrecoverableKeyExceptionKeyStoreExceptionpublic String getDefCertAlias()
CertificateContainerIfcnullgetDefCertAlias in interface CertificateContainerIfcpublic CertificateEntry getCertificateEntry(String hostname)
getCertificateEntry in interface CertificateContainerIfcpublic KeyManager[] getKeyManagers(String hostname)
CertificateContainerIfcKeyManager with certificate for domain or null if there is no
certificate for domaingetKeyManagers in interface CertificateContainerIfcpublic TrustManager[] getTrustManagers()
getTrustManagers in interface CertificateContainerIfcpublic KeyStore getTrustStore()
getTrustStore in interface CertificateContainerIfcpublic void init(Map<String,Object> params)
CertificateContainerIfcinit in interface CertificateContainerIfcpublic void initialize()
Initializableinitialize in interface Initializablepublic void beforeUnregister()
UnregisterAwarebeforeUnregister in interface UnregisterAware@HandleEvent public void certificateChange(CertificateContainer.CertificateChange event)
Copyright © 2004–2019 "Tigase, Inc.". All rights reserved.