'Base64-decode and decrypt a value if crypto meta can be extracted from
the value itself, otherwise return the value unmodified.
A value should either be a string that does not contain the \';\'
character or should be of the form:
<base64-encoded ciphertext>;swift_meta=<crypto meta>
:param value: value to decrypt
:param key: crypto key to use
:param required: if True then the value is required to be decrypted
and an EncryptionException will be raised if the
header cannot be decrypted due to missing crypto meta.
:returns: decrypted value if crypto meta is found, otherwise the
unmodified value
:raises EncryptionException: if an error occurs while parsing crypto
meta or if the header value was required
to be decrypted but crypto meta was not
found.'

def decrypt_value_with_meta(self, value, key, required=False):

    (value, crypto_meta) = extract_crypto_meta(value)
    if crypto_meta:
        self.crypto.check_crypto_meta(crypto_meta)
        value = self.decrypt_value(value, key, crypto_meta)
    elif required:
        raise EncryptionException(('Missing    crypto    meta    in    value    %s' % value))
    return value
