

def get_certificate(context, signature_certificate_uuid):
    'Create the certificate object from the retrieved certificate data.\n\n    :param context: the user context for authentication\n    :param signature_certificate_uuid: the uuid to use to retrieve the\n                                       certificate\n    :returns: the certificate cryptography object\n    :raises: SignatureVerificationError if the retrieval fails or the format\n             is invalid\n    '
    keymgr_api = key_manager.API()
    try:
        cert = keymgr_api.get(context, signature_certificate_uuid)
    except KeyManagerError as e:
        msg = (_LE('Unable to retrieve certificate with ID %(id)s: %(e)s') % {
            'id': signature_certificate_uuid,
            'e': encodeutils.exception_to_unicode(e),
        })
        LOG.error(msg)
        raise exception.SignatureVerificationError(reason=(_('Unable to retrieve certificate with ID: %s') % signature_certificate_uuid))
    if (cert.format not in CERTIFICATE_FORMATS):
        raise exception.SignatureVerificationError(reason=(_('Invalid certificate format: %s') % cert.format))
    if (cert.format == X_509):
        cert_data = cert_data.get_encoded()
        certificate = x509.load_der_x509_certificate(cert_data, default_backend())
    verify_certificate(certificate)
    return certificate

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/signature_utils.py get_certificate/VarMisuse@143/364 `cert`->`cert_data`