@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
CertificateContainerIfc
addCertificates
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 CertificateContainerIfc
params
- a Map
value with configuration parameters.CertificateParsingException
public KeyManager[] createCertificate(String alias) throws NoSuchAlgorithmException, CertificateException, SignatureException, NoSuchProviderException, InvalidKeyException, IOException, UnrecoverableKeyException, KeyStoreException
CertificateContainerIfc
createCertificate
allows to generate self-signed certificate for passed domain name.screateCertificate
in interface CertificateContainerIfc
alias
- domain for which certificate should be generatedKeyManager
containing generated certificateNoSuchAlgorithmException
CertificateException
SignatureException
NoSuchProviderException
InvalidKeyException
IOException
UnrecoverableKeyException
KeyStoreException
public String getDefCertAlias()
CertificateContainerIfc
null
getDefCertAlias
in interface CertificateContainerIfc
public CertificateEntry getCertificateEntry(String hostname)
getCertificateEntry
in interface CertificateContainerIfc
public KeyManager[] getKeyManagers(String hostname)
CertificateContainerIfc
KeyManager
with certificate for domain or null
if there is no
certificate for domaingetKeyManagers
in interface CertificateContainerIfc
public TrustManager[] getTrustManagers()
getTrustManagers
in interface CertificateContainerIfc
public KeyStore getTrustStore()
getTrustStore
in interface CertificateContainerIfc
public void init(Map<String,Object> params)
CertificateContainerIfc
init
in interface CertificateContainerIfc
public void initialize()
Initializable
initialize
in interface Initializable
public void beforeUnregister()
UnregisterAware
beforeUnregister
in interface UnregisterAware
@HandleEvent public void certificateChange(CertificateContainer.CertificateChange event)
Copyright © 2004–2020 "Tigase, Inc.". All rights reserved.