Skip to content

Commit

Permalink
Merge pull request #128 from pauphi/fix/ca-keyid
Browse files Browse the repository at this point in the history
Fix for CA when keyId is not nil
  • Loading branch information
AndyQ authored Jun 12, 2022
2 parents 72a41af + 2c958cb commit d369c9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/NFCPassportReader/DataGroups/SecurityInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ public class SecurityInfo {
if optionalData == nil {
return ChipAuthenticationPublicKeyInfo(oid:oid, pubKey:subjectPublicKeyInfo);
} else {
let keyId = Int(optionalData!.value)
let keyId = Int(optionalData!.value, radix: 16)
return ChipAuthenticationPublicKeyInfo(oid:oid, pubKey:subjectPublicKeyInfo, keyId: keyId);
}

}
} else if ChipAuthenticationInfo.checkRequiredIdentifier(oid) {
let version = Int(requiredData.value) ?? -1
if let optionalData = optionalData {
let keyId = Int(optionalData.value)
let keyId = Int(optionalData.value, radix: 16)
return ChipAuthenticationInfo(oid: oid, version: version, keyId: keyId);
} else {
return ChipAuthenticationInfo(oid: oid, version: version);
Expand Down

0 comments on commit d369c9d

Please sign in to comment.