Format of the passport id

ppppppppppPcccbbbbbbBseeeeeeE<<<<<<<<<<<<<<<C

p	passport number. In some cases the passport number also includes the 10th digit(P)
P	checksum passport number
c	country code
b	date of birth (YY-MM-DD)
B	checksum date of birth
s	gender M|F (Note: this field is unused on German id-cards)
e	date of expiration
E	checksum date of expiration
C	checksum over all numeric fields

Blank spaces are padded with '<'. In some cases the C has a leading '0'.


Calculation of the checksums

1.	The first digit is multiplied by 7,
	the second digit is multiplied by 3,
	the third digit is multiplied by 1,
	and so on (the fourth with 7, fifth with 3, ...)

2.	These numbers are added to a sum

3.	The checksum is the last digit of the sum (mod 10)

Notes

* Only numeric values are included in the checksum
* The last checksum (C) includes the previous checksums

Sources

This article is based on a description of German id cards 
(http://mitglied.lycos.de/tiloulbrich/programmierung/perso.pdf)
written by Tilo Ulbrich.