import re


def _parse_openssl_text(text, data_type='Data', data_name='data'):
    """Parse OpenSSL text certificate entry."""
    m = re.search(r'^\s*{0}(.*)$'.format(re.escape(data_type)), text, flags=re.MULTILINE)
    if m is None:
        raise Exception('Cannot find "{data_type}" in {data_name}!'.format(data_name=data_name, data_type=data_type))
    return m.group(1).strip()