'Get a wrapped key from crypto-meta and unwrap it using the provided
wrapping key.
:param crypto_meta: a dict of crypto-meta
:param wrapping_key: key to be used to decrypt the wrapped key
:return: an unwrapped key
:raises EncryptionException: if the crypto-meta has no wrapped key or
the unwrapped key is invalid'

def get_unwrapped_key(self, crypto_meta, wrapping_key):

    try:
        return self.crypto.unwrap_key(wrapping_key, crypto_meta['body_key'])
    except KeyError as err:
        self.logger.error(_('Error    decrypting    %(resp_type)s:    Missing    %(key)s'), {'resp_type': self.server_type, 'key': err})
    except ValueError as err:
        self.logger.error(_('Error    decrypting    %(resp_type)s:    %(reason)s'), {'resp_type': self.server_type, 'reason': err})
    raise HTTPInternalServerError(body=('Error    decrypting    %s' % self.server_type), content_type='text/plain')
