Package tigase.io
Interface CertificateContainerIfc
-
- All Known Implementing Classes:
CertificateContainer
public interface CertificateContainerIfcInterface implemented by classes responsible for keeping SSL certificates in memory
Created by andrzej on 29.02.2016.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCERTIFICATE_CONTAINER_CLASS_KEYstatic java.lang.StringCERTIFICATE_CONTAINER_CLASS_VAL
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddCertificates(java.util.Map<java.lang.String,java.lang.String> params)MethodaddCertificatesallows to add more certificates at run time after the container has bee already initialized.javax.net.ssl.KeyManager[]createCertificate(java.lang.String domain)MethodcreateCertificateallows to generate self-signed certificate for passed domain name.sCertificateEntrygetCertificateEntry(java.lang.String hostname)java.lang.StringgetDefCertAlias()Method to retrieve default alias of certificate to use when domain isnulljavax.net.ssl.KeyManager[]getKeyManagers(java.lang.String domain)Method returns array ofKeyManagerwith certificate for domain ornullif there is no certificate for domainjavax.net.ssl.TrustManager[]getTrustManagers()java.security.KeyStoregetTrustStore()voidinit(java.util.Map<java.lang.String,java.lang.Object> params)Method used to pass parameters to initialize instance of class
-
-
-
Field Detail
-
CERTIFICATE_CONTAINER_CLASS_KEY
static final java.lang.String CERTIFICATE_CONTAINER_CLASS_KEY
- See Also:
- Constant Field Values
-
CERTIFICATE_CONTAINER_CLASS_VAL
static final java.lang.String CERTIFICATE_CONTAINER_CLASS_VAL
-
-
Method Detail
-
addCertificates
void addCertificates(java.util.Map<java.lang.String,java.lang.String> params) throws java.security.cert.CertificateParsingExceptionMethodaddCertificatesallows 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.- Parameters:
params- aMapvalue with configuration parameters.- Throws:
java.security.cert.CertificateParsingException
-
createCertificate
javax.net.ssl.KeyManager[] createCertificate(java.lang.String domain) throws java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.security.SignatureException, java.security.NoSuchProviderException, java.security.InvalidKeyException, java.io.IOException, java.security.UnrecoverableKeyException, java.security.KeyStoreExceptionMethodcreateCertificateallows to generate self-signed certificate for passed domain name.s- Parameters:
domain- domain for which certificate should be generated- Returns:
- an array of
KeyManagercontaining generated certificate - Throws:
java.security.NoSuchAlgorithmExceptionjava.security.cert.CertificateExceptionjava.security.SignatureExceptionjava.security.NoSuchProviderExceptionjava.security.InvalidKeyExceptionjava.io.IOExceptionjava.security.UnrecoverableKeyExceptionjava.security.KeyStoreException
-
getDefCertAlias
java.lang.String getDefCertAlias()
Method to retrieve default alias of certificate to use when domain isnull- Returns:
- default alias
-
getCertificateEntry
CertificateEntry getCertificateEntry(java.lang.String hostname)
-
getKeyManagers
javax.net.ssl.KeyManager[] getKeyManagers(java.lang.String domain)
Method returns array ofKeyManagerwith certificate for domain ornullif there is no certificate for domain
-
getTrustManagers
javax.net.ssl.TrustManager[] getTrustManagers()
-
getTrustStore
java.security.KeyStore getTrustStore()
-
init
void init(java.util.Map<java.lang.String,java.lang.Object> params)
Method used to pass parameters to initialize instance of class
-
-