

def get_public_key(context, signature_certificate_uuid, signature_key_type):
    'Create the public key object from a retrieved certificate.\n\n    :param context: the user context for authentication\n    :param signature_certificate_uuid: the uuid to use to retrieve the\n                                       certificate\n    :param signature_key_type: a SignatureKeyType object\n    :returns: the public key cryptography object\n    :raises: SignatureVerificationError if public key format is invalid\n    '
    certificate = get_certificate(context, signature_certificate_uuid)
    public_key = certificate.public_key()
    if (not isinstance(public_key, signature_key_type.public_key_type)):
        raise exception.SignatureVerificationError(reason=(_('Invalid public key type for signature key type: %s') % signature_key_type.name))
    return public_key

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/signature_utils.py get_public_key/original