Skip to content

Commit ce47ac9

Browse files
[bugfix] mdoc issuer_date and expiry_date need the tag '1004'.
1 parent ee970b6 commit ce47ac9

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/main/java/com/authlete/jaxrs/server/vc/MdocOrderProcessor.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,8 @@ private static void addMDLClaims(
343343
// If the "issue_date" claim is requested.
344344
if (requestedSubclaims.containsKey(MDLClaimNames.ISSUE_DATE))
345345
{
346-
// "issue_date": "YYYY-MM-DD"
347-
subclaims.put(
348-
MDLClaimNames.ISSUE_DATE,
349-
now.format(DateTimeFormatter.ISO_LOCAL_DATE));
346+
// "issue_date": 1004("YYYY-MM-DD")
347+
subclaims.put(MDLClaimNames.ISSUE_DATE, toFullDate(now));
350348
}
351349

352350
// If the "expiry_date" claim is requested.
@@ -357,13 +355,18 @@ private static void addMDLClaims(
357355
ZonedDateTime exp = now.plusYears(1);
358356

359357
// "expiry_date": "YYYY-MM-DD"
360-
subclaims.put(
361-
MDLClaimNames.EXPIRY_DATE,
362-
exp.format(DateTimeFormatter.ISO_LOCAL_DATE));
358+
subclaims.put(MDLClaimNames.EXPIRY_DATE, toFullDate(exp));
363359
}
364360
}
365361

366362

363+
private static String toFullDate(ZonedDateTime dt)
364+
{
365+
return String.format("cbor:1004(\"%s\")",
366+
dt.format(DateTimeFormatter.ISO_LOCAL_DATE));
367+
}
368+
369+
367370
@Override
368371
protected long computeCredentialDuration()
369372
{

0 commit comments

Comments
 (0)