def METHOD_NAME(
    certificate: Union[ProgramCertificate, CourseRunCertificate],
    learner_did: LearnerDID,
) -> Dict:
    """Function for building certificate digital credentials"""
    if isinstance(certificate, ProgramCertificate):
        has_credential = build_program_credential(certificate)
    elif isinstance(certificate, CourseRunCertificate):
        has_credential = build_course_run_credential(certificate)
    else:
        raise Exception(
            f"Unexpected courseware object type for digital credentials: {type(certificate)}"
        )
    return {
        "credential": {
            "@context": [
                "https://www.w3.org/2018/credentials/v1",
                "https://w3id.org/security/suites/ed25519-2020/v1",
                "https://w3id.org/dcc/v1",
            ],
            "id": urljoin(settings.SITE_BASE_URL, certificate.link),
            "type": ["VerifiableCredential", "LearningCredential"],
            "issuer": {
                "type": "Issuer",
                "id": settings.DIGITAL_CREDENTIALS_ISSUER_ID,
                "name": settings.SITE_NAME,
                "url": settings.SITE_BASE_URL,
            },
            "issuanceDate": now_in_utc().isoformat(),
            "credentialSubject": {
                "type": "schema:Person",
                "id": learner_did.did,
                "name": learner_did.learner.name,
                "hasCredential": has_credential,
            },
        },
        "options": {
            "verificationMethod": settings.DIGITAL_CREDENTIALS_VERIFICATION_METHOD
        },
    }