Skip to content

Commit

Permalink
New vehicle card ATR
Browse files Browse the repository at this point in the history
  • Loading branch information
ubavic committed Jul 15, 2024
1 parent f3abebe commit d600d3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions card/card.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ func ReadCard(sc Card) (doc.Document, error) {
card = VehicleCard{smartCard: sc}
} else if slices.Equal(smartCardStatus.Atr, VEHICLE_ATR_3) {
card = VehicleCard{smartCard: sc}
} else if slices.Equal(smartCardStatus.Atr, VEHICLE_ATR_4) {
card = VehicleCard{smartCard: sc}
} else {
return nil, fmt.Errorf("unknown card type: %s", hex.EncodeToString(smartCardStatus.Atr))
}
Expand Down
6 changes: 6 additions & 0 deletions card/vehicle.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ var VEHICLE_ATR_3 = []byte{
0x73, 0x02, 0x05, 0x04, 0x47,
}

var VEHICLE_ATR_4 = []byte{
0x3B, 0x9D, 0x18, 0x81, 0x31, 0xFC, 0x35, 0x80,
0x31, 0xC0, 0x69, 0x4D, 0x54, 0x43, 0x4F, 0x53,
0x73, 0x02, 0x05, 0x02, 0xD4,
}

func readVehicleCard(card VehicleCard) (*document.VehicleDocument, error) {
doc := document.VehicleDocument{}
data := BER{}
Expand Down

0 comments on commit d600d3e

Please sign in to comment.