<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_authenticated_subjects(cert_pem):
 """Return primary subject and set of equivalents authenticated by certificate. - ``cert_pem`` can be str or bytes """

    if isinstance(cert_pem, str):
        cert_pem = cert_pem.encode('utf-8')
    return d1_common.cert.subjects.extract_subjects(cert_pem)