Package tigase.io

Class CertificateContainer

    • Field Detail

      • PER_DOMAIN_CERTIFICATE_KEY

        public static final java.lang.String PER_DOMAIN_CERTIFICATE_KEY
        See Also:
        Constant Field Values
    • Constructor Detail

      • CertificateContainer

        public CertificateContainer()
    • Method Detail

      • addCertificates

        public void addCertificates​(java.util.Map<java.lang.String,​java.lang.String> params)
                             throws java.security.cert.CertificateParsingException
        Description copied from interface: CertificateContainerIfc
        Method 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.
        Specified by:
        addCertificates in interface CertificateContainerIfc
        Parameters:
        params - a Map value with configuration parameters.
        Throws:
        java.security.cert.CertificateParsingException
      • createCertificate

        public javax.net.ssl.KeyManager[] createCertificate​(java.lang.String alias)
                                                     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.KeyStoreException
        Description copied from interface: CertificateContainerIfc
        Method createCertificate allows to generate self-signed certificate for passed domain name.s
        Specified by:
        createCertificate in interface CertificateContainerIfc
        Parameters:
        alias - domain for which certificate should be generated
        Returns:
        an array of KeyManager containing generated certificate
        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.KeyStoreException
      • getKeyManagers

        public javax.net.ssl.KeyManager[] getKeyManagers​(java.lang.String hostname)
        Description copied from interface: CertificateContainerIfc
        Method returns array of KeyManager with certificate for domain or null if there is no certificate for domain
        Specified by:
        getKeyManagers in interface CertificateContainerIfc
      • init

        public void init​(java.util.Map<java.lang.String,​java.lang.Object> params)
        Description copied from interface: CertificateContainerIfc
        Method used to pass parameters to initialize instance of class
        Specified by:
        init in interface CertificateContainerIfc
      • initialize

        public void initialize()
        Description copied from interface: Initializable
        Method will be called, when bean will be created, configured and ready to use.
        Specified by:
        initialize in interface Initializable