@@ -5,6 +5,7 @@ import android.security.keystore.KeyProperties
55import android.util.Base64
66import android.util.Log
77import com.credman.cmwallet.CmWalletApplication.Companion.TAG
8+ import com.credman.cmwallet.CmWalletApplication.Companion.getCurrentTime
89import com.credman.cmwallet.createJWTES256
910import com.credman.cmwallet.jweDecrypt
1011import com.credman.cmwallet.jweSerialization
@@ -224,7 +225,7 @@ class OpenId4VCI(val credentialOfferJson: String) {
224225 val clientAttestationPayload = buildJsonObject {
225226 put(" sub" , WALLET_CLIENT_ID )
226227 put(" wallet_name" , WALLET_NAME )
227- put(" exp" , Instant .now().epochSecond + 432000 /* 5 days */ )
228+ put(" exp" , getCurrentTime() + 432000 /* 5 days */ )
228229 put(" cnf" , buildJsonObject {
229230 put(" jwk" , kp.public.toJWK())
230231 })
@@ -240,7 +241,7 @@ class OpenId4VCI(val credentialOfferJson: String) {
240241 val clientAttestationPopPayload = buildJsonObject {
241242 put(" aud" , authServerIdentifier())
242243 put(" jti" , Uuid .random().toByteArray().encodeBase64())
243- put(" iat" , Instant .now().epochSecond )
244+ put(" iat" , getCurrentTime() )
244245 put(" challenge" , challenge)
245246 }
246247 return createJWTES256(clientAttestationPopHeader, clientAttestationPopPayload, kp.private)
@@ -256,7 +257,7 @@ class OpenId4VCI(val credentialOfferJson: String) {
256257 put(" jti" , Uuid .random().toByteArray().encodeBase64())
257258 put(" htm" , method)
258259 put(" htu" , endpoint)
259- put(" iat" , Instant .now().epochSecond )
260+ put(" iat" , getCurrentTime() )
260261 ath?.let { put(" ath" , ath) }
261262 dpopNonce?.let { put(" nonce" , dpopNonce) }
262263 }
@@ -405,7 +406,7 @@ class OpenId4VCI(val credentialOfferJson: String) {
405406 },
406407 payload = buildJsonObject {
407408 put(" aud" , credentialOffer.credentialIssuer)
408- put(" iat" , Instant .now().epochSecond )
409+ put(" iat" , getCurrentTime() )
409410 put(" nonce" , nonceResponse.cNonce)
410411 },
411412 privateKey = privateKey
0 commit comments