@@ -237,16 +237,19 @@ async def create_credential_offer(
237237 credential_config_id : str ,
238238 issuer_did : str ,
239239 pin : str | None = None ,
240+ credential_subject : dict | None = None ,
240241) -> dict :
241242 """Create a pre-authorized credential offer and return offer details."""
242- exchange_body : dict [str , Any ] = {
243- "supported_cred_id" : credential_config_id ,
244- "credential_subject" : {
243+ if credential_subject is None :
244+ credential_subject = {
245245 "given_name" : "Alice" ,
246246 "family_name" : "Smith" ,
247247 "email" : "alice@example.com" ,
248248 "birthdate" : "1990-01-15" ,
249- },
249+ }
250+ exchange_body : dict [str , Any ] = {
251+ "supported_cred_id" : credential_config_id ,
252+ "credential_subject" : credential_subject ,
250253 # verification_method format: {did}#0 (selects the first key on the DID)
251254 "verification_method" : f"{ issuer_did } #0" ,
252255 }
@@ -773,6 +776,19 @@ async def main() -> None:
773776 ISSUER_ADMIN_URL ,
774777 mdoc_config ["supported_cred_id" ],
775778 p256_did ,
779+ credential_subject = {
780+ "family_name" : "Smith" ,
781+ "given_name" : "Alice" ,
782+ "birth_date" : "1990-01-15" ,
783+ "issue_date" : "2024-01-01" ,
784+ "expiry_date" : "2029-01-01" ,
785+ "issuing_country" : "US" ,
786+ "issuing_authority" : "US DMV" ,
787+ "document_number" : "DL-12345678" ,
788+ "portrait" : "bXVzdGFjaGlv" ,
789+ "driving_privileges" : [],
790+ "un_distinguishing_sign" : "USA" ,
791+ },
776792 )
777793
778794 setup_output ["issuer" ] = {
0 commit comments