(certificate, private_key, intermediates=None,
                   private_key_passphrase=None, **kwargs)
return cert_ref
Stores (i.e., registers) a cert with the cert manager.

        This method stores the specified cert to the filesystem and returns
        a UUID that can be used to retrieve it.

        :param certificate: PEM encoded TLS certificate
        :param private_key: private key for the supplied certificate
        :param intermediates: ordered and concatenated intermediate certs
        :param private_key_passphrase: optional passphrase for the supplied key

        :returns: the UUID of the stored cert
        :raises CertificateStorageException: if certificate storage fails
Stores (i.e., registers) a cert with the cert manager.
Stores ( i . e . registers ) a cert with the cert manager .
def store_cert(certificate, private_key, intermediates=None,
                   private_key_passphrase=None, **kwargs):
        """Stores (i.e., registers) a cert with the cert manager.

        This method stores the specified cert to the filesystem and returns
        a UUID that can be used to retrieve it.

        :param certificate: PEM encoded TLS certificate
        :param private_key: private key for the supplied certificate
        :param intermediates: ordered and concatenated intermediate certs
        :param private_key_passphrase: optional passphrase for the supplied key

        :returns: the UUID of the stored cert
        :raises CertificateStorageException: if certificate storage fails
        """
        cert_ref = str(uuid.uuid4())
        filename_base = os.path.join(CONF.certificates.storage_path, cert_ref)

        LOG.warning(
            "Storing certificate data on the local filesystem. "
            "CertManager type 'local' should be used for testing purpose."
        )
        try:
            filename_certificate = "{0}.crt".format(filename_base)
            with open(filename_certificate, 'w') as cert_file:
                cert_file.write(certificate)

            filename_private_key = "{0}.key".format(filename_base)
            with open(filename_private_key, 'w') as key_file:
                key_file.write(private_key)

            if intermediates:
                filename_intermediates = "{0}.int".format(filename_base)
                with open(filename_intermediates, 'w') as int_file:
                    int_file.write(intermediates)

            if private_key_passphrase:
                filename_pkp = "{0}.pass".format(filename_base)
                with open(filename_pkp, 'w') as pass_file:
                    pass_file.write(private_key_passphrase)
        except IOError as ioe:
            LOG.error("Failed to store certificate.")
            raise exception.CertificateStorageException(msg=str(ioe))

        return cert_ref
def store_cert ( certificate , private_key , intermediates = None , private_key_passphrase = None , * * kwargs ) : cert_ref = str ( uuid . uuid4 ( ) ) filename_base = os . path . join ( CONF . certificates . storage_path , cert_ref ) LOG . warning ( "Storing certificate data on the local filesystem. " "CertManager type 'local' should be used for testing purpose." ) try : filename_certificate = "{0}.crt" . format ( filename_base ) with open ( filename_certificate , 'w' ) as cert_file : cert_file . write ( certificate ) filename_private_key = "{0}.key" . format ( filename_base ) with open ( filename_private_key , 'w' ) as key_file : key_file . write ( private_key ) if intermediates : filename_intermediates = "{0}.int" . format ( filename_base ) with open ( filename_intermediates , 'w' ) as int_file : int_file . write ( intermediates ) if private_key_passphrase : filename_pkp = "{0}.pass" . format ( filename_base ) with open ( filename_pkp , 'w' ) as pass_file : pass_file . write ( private_key_passphrase ) except IOError as ioe : LOG . error ( "Failed to store certificate." ) raise exception . CertificateStorageException ( msg = str ( ioe ) ) return cert_ref