<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.yobi.be/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=212.71.5.64</id>
	<title>YobiWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.yobi.be/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=212.71.5.64"/>
	<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Special:Contributions/212.71.5.64"/>
	<updated>2026-04-08T16:24:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=2946</id>
		<title>Belgian eID</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=2946"/>
		<updated>2008-03-05T07:48:18Z</updated>

		<summary type="html">&lt;p&gt;212.71.5.64: /* Thunderbird security module */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Belgian eID is part of the efforts of the government for [[Belgian eGov]]&lt;br /&gt;
==Officials==&lt;br /&gt;
&lt;br /&gt;
* [http://eid.belgium.be Official eID portal]&lt;br /&gt;
* [http://repository.eid.belgium.be/FR/Index.htm Certificates]&lt;br /&gt;
* [http://status.eid.belgium.be/ eID services]&lt;br /&gt;
* [http://crl.eid.belgium.be/ Revocation lists] and [http://ocsp.eid.belgium.be/ OCSP server]&lt;br /&gt;
* [http://eid.belgium.be/fr/navigation/documents/37129.html Circulaires (fr) eID Home  /  Villes et communes  /  Quoi  /  Circulaires]&amp;lt;br&amp;gt;Among others:&amp;lt;br&amp;gt; 3) FORMULAIRE DE RENONCIATION AUX CERTIFICATS DE LA CARTE D’IDENTITE ELECTRONIQUE AU MOMENT DE LA DEMANDE DE LA CARTE&amp;lt;br&amp;gt;10) MODELE D’ATTESTATION D’ACTIVATION OU DE REVOCATION DES CERTIFICATS APRES ACTIVATION DE LA CARTE&amp;lt;br&amp;gt;11) MODELE D’ATTESTATION DE SUSPENSION ET DE REACTIVATION DES CERTIFICATS&lt;br /&gt;
* [http://www.certipost.be CertiPost], by Belgacom &amp;amp; La Poste/De Post&lt;br /&gt;
** [http://www.certipost.be/x500/X500.html Certipost E-Trust™ Public X500 Directory Search]&lt;br /&gt;
&lt;br /&gt;
==Usage &amp;amp; Software==&lt;br /&gt;
&lt;br /&gt;
* [http://www.belgium.be/zip/eid_datacapture_fr.html Middleware &amp;amp; developer&#039;s kit]&lt;br /&gt;
** There are also Debian packages, cf below my tests under Linux&lt;br /&gt;
** [http://developer.novell.com/wiki/index.php/EID-belgium eID configuration toolkit by Novell]&lt;br /&gt;
* [http://homes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/WebHome Danny De Cock&#039;s page on eID] (same as http://www.godot.be)&lt;br /&gt;
* [http://weblogs.asp.net/cumpsd/archive/2005/04/03/396900.aspx short intro]&lt;br /&gt;
* [http://weblogs.asp.net/cumpsd/archive/2005/04/03/396901.aspx how to use the eID card within your .NET apps]&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
* http://www.foo.be/eID/ Official data, spec sheet etc (outdated)&lt;br /&gt;
* [http://belsec.skynetblogs.be/tag/1/E-ID Belsec blog entries] about the eID&lt;br /&gt;
* [http://www.uvcw.be/no_index/e-communes/dossier_eid/Belgian_eID_Run-time_Users_guide.pdf Belgian E-ID runtime guide windows/linux pdf]&lt;br /&gt;
* [http://www.porvoo8.rrn.fgov.be/porvoo8/doc13/09_porvoo8-bruegger18_Italy.pdf Open source interoperability and E-ID pdf]&lt;br /&gt;
* [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/5%20aspects%20techniques/fr/belpic_eid_version_numbering_v1.5.2.pdf The versioning of E-ID pdf]&lt;br /&gt;
* [http://porvoo10.net/p10/10_porvoo10-bud-25.pdf The road to European E-ID interoperability pdf]&lt;br /&gt;
* [http://www.microsoft.com/belux/nl/eid/ Microsoft and the eID], just an old marketing buzz? (I wouldn&#039;t complain...)&lt;br /&gt;
* [http://samba.grep.be/~wouter/beid-screencast.ogg], BeID screencast of what should have been shown at Fosdem 2008, by Wouter. (still waiting for the video of the presentation...)&lt;br /&gt;
* [http://www.lalibre.be/societe/cyber/article/404626/la-carte-d-identite-electronique-permettra-de-s-enregistrer-sur-ebay.html] La carte d&#039;identité électronique permettra de s&#039;enregistrer sur eBay&lt;br /&gt;
&lt;br /&gt;
==I revoked my certificates==&lt;br /&gt;
===Why?===&lt;br /&gt;
Because at that time I knew too few on the details of the eID architecture and too much about how a new security architecture can have flaws, so better to stay away for a while, especially given the legal implications that the eID can bring.&amp;lt;br&amp;gt;I knew they were talking about two certificates without understanding their difference, so let&#039;s revoke both.&amp;lt;br&amp;gt;Note that it doesn&#039;t mean my eID is not valid, eID card activation is mandatory. The eID card is a proof of identity and residence of a person in Belgium. eID certificates activation is a choice of the holder of the eID (opt-in), he/she can decide to activate or revoke the certificates. (cf [http://www.certipost.be/dpsolutions/en/eid-faq.html FAQ])&lt;br /&gt;
===How?===&lt;br /&gt;
It was quite epic.&lt;br /&gt;
&amp;lt;br&amp;gt;I was still a bit prepared, hopefully, so I had printed the Annexes 3 &amp;amp; 10, the legal forms to ask either to renounce to have the certificates or to revoke them just after activation, as well as the relevant parts of the User Manual for the civil servants :-)&lt;br /&gt;
&amp;lt;br&amp;gt;I printed both as for me it was not clear from the User Manual how to renounce for the certificates.&lt;br /&gt;
* [Me] Good morning, I come for my eID and... I want to get rid of the certificates&lt;br /&gt;
* [Her] You what? Is it possible? Never heard about that&lt;br /&gt;
* [Me] Yes, yes, see (and I show her what&#039;s in her User Manual)&lt;br /&gt;
* ... (takes a while to digest the info)&lt;br /&gt;
* [Her] Ha ok, you&#039;ve to fill Annex 3, (shouting behind her shoulder) JOSETTE, DO WE HAVE ANNEX 3???&lt;br /&gt;
* [Josette] ANNEX WHAT??&lt;br /&gt;
* [Me] No prob, look (and I pull out my own copy of [http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/03_-_FORMULAIRE_RENONCIATION_CERTIFS.pdf Annex 3 (pdf)])&lt;br /&gt;
* ... (meanwhile she has no idea what to do on the eID to fulfill renouncement and I agree with her, the Manual was unclear so we went for activation+revocation)&lt;br /&gt;
* [Me] No prob, look (and I pull out my own copy of [http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/10_-_Attestation_activ_Certificats(18-10)_27-07.pdf Annex 10 (pdf)])&lt;br /&gt;
* [Her] Can I take your copies before you fill them? I&#039;ll make copies for ourselves.&lt;br /&gt;
So today the official Annex 3&amp;amp;10 forms of this civil office are mine :-D&amp;lt;br&amp;gt;Who knows, maybe I crafted the form... ;-)&lt;br /&gt;
&lt;br /&gt;
It is &amp;quot;funny&amp;quot; to see that everywhere the activation of the certificates is presented as optional, the choice being left to the citizen, blablabla, but in reality most of the citizen just don&#039;t know about this possibility (and most of the civil servants, well I hope that since my story, things have evolved a bit) and the civil servants doesn&#039;t ask you the question.&lt;br /&gt;
&lt;br /&gt;
===Some details about those certificates===&lt;br /&gt;
The eID contains 2 signature certificates, so you cannot encrypt with them, just sign.&lt;br /&gt;
* One labeled &amp;quot;Authentication&amp;quot; is for daily use &lt;br /&gt;
** To log in on SSL websites such as [http://minfin.fgov.be/taxonweb/ Tax-on-web] or [http://www.saferchat.be SaferChat] or even your bank e.g. [http://www.keytradebank.com/pdf/eID_en.pdf Keytrade has implemented it (pdf)] with CRL check&lt;br /&gt;
** For signing mails with S/MIME&lt;br /&gt;
** For your own purpose, to log on your SSH server, SSL server, VPN etc&lt;br /&gt;
* One labeled &amp;quot;Signature&amp;quot; is for special cases&lt;br /&gt;
** It has a equivalent legal value as a hand-written signature and is referred as non-repudiation signature.&lt;br /&gt;
** According to [http://www.certipost.be/dpsolutions/images/stories/e-signing/right/applicability_en.pdf CertiPost applicability guidelines (pdf)], the electronic signature still cannot replace a hand-written signature in a number of cases&lt;br /&gt;
**It&#039;s automatically revoked for minors under 18 years as they cannot sign legally yet.&lt;br /&gt;
**From [http://www.certipost.be/dpsolutions/en/eid-faq.html Certipost FAQ]:&amp;lt;br&amp;gt;&#039;&#039;Non-repudiation guarantees that one cannot deny having performed an act. E.g. any message signed using a person&#039;s digital signature can only have come from this person. The signing person can not claim that the message was not originated by him.&amp;lt;br&amp;gt;In other words, non-repudiation means that information &#039;&#039;&#039;cannot be disclaimed&#039;&#039;&#039;, similar to a &#039;&#039;&#039;witnessed&#039;&#039;&#039; handwritten signature on a paper document.&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;to be checked in the law&#039;&#039;&lt;br /&gt;
** Normal pkcs software doesn&#039;t seem to be able to use it (?)&lt;br /&gt;
** Should be used only through the Government software which prompts you with a special GUI and warnings about the legal power of this signature&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/en/rem-overzicht.html CertiPost e-Registered mails] is using the non-repudiation signature&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/en/e-signing-overview.html CertiPost e-Signing] is using the non-repudiation signature&lt;br /&gt;
* Both are protected by the same PIN which is typed on your (unsafe) PC&lt;br /&gt;
&lt;br /&gt;
===What says the law===&lt;br /&gt;
Sorry, here are french version abstracts.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;9 JUILLET 2001. - Loi fixant certaines règles relatives au cadre juridique pour les signatures électroniques et les services de certification&#039;&#039;&#039;, date de publication au Moniteur: 29 septembre 2001&lt;br /&gt;
&amp;lt;br&amp;gt;Morceaux choisis:&lt;br /&gt;
* Art. 4. § 1er. A défaut de dispositions légales contraires, nul ne peut être contraint de poser un acte juridique par voie électronique.&lt;br /&gt;
* § 4. Sans préjudice des articles 1323 et suivants du Code civil, une signature électronique avancée réalisée sur la base d&#039;un certificat qualifié et conçue au moyen d&#039;un dispositif sécurisé de création de signature électronique, est assimilée à une signature manuscrite, qu&#039;elle soit réalisée par une personne physique ou morale.&lt;br /&gt;
* § 5. Une signature électronique ne peut être privée de son efficacité juridique et ne peut être refusée comme preuve en justice au seul motif :&lt;br /&gt;
** que la signature se présente sous forme électronique, ou&lt;br /&gt;
** qu&#039;elle ne repose pas sur un certificat qualifié, ou&lt;br /&gt;
** qu&#039;elle ne repose pas sur un certificat qualifié délivré par un prestataire accrédité de service de certification, ou&lt;br /&gt;
** qu&#039;elle n&#039;est pas créée par un dispositif sécurisé de création de signature.&lt;br /&gt;
* &#039;&#039;Wait a minute, ANY electronic signature NOT being based on a qualified certificate and NOT created in a secure environment CANNOT be refused as a legal proof???&amp;lt;br&amp;gt;Maybe it&#039;s me or the triple-negation sentences (lawyers, lawyers...) but it looks like § 5 goes much further than § 4&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===What do I think today?===&lt;br /&gt;
====Catastrophe scenario==== &lt;br /&gt;
* Someone captures your PIN while you&#039;re using it for &amp;quot;just authentication&amp;quot; via e.g. malware, virus, trojan, worm on the PC &lt;br /&gt;
** you know, the kind of stuff that never happens, anyway it&#039;s now [http://eid.belgium.be/fr/navigation/documents/39814.html your problem] even if the official middleware [http://blog.didierstevens.com/2007/12/31/how-can-i-trust-the-beid-runtime/ is not signed]&lt;br /&gt;
**And apparently even some readers with integrated keypads are [http://belsec.skynetblogs.be/post/5426553/belgian-eid-nr-11--keyloggers-work-with-eid not safer :-(]&lt;br /&gt;
**And apparently even commercial standalone smatcard terminals are [http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-711.pdf not safer :-( (pdf)]&lt;br /&gt;
**And, oh, I did a small test with [[Keyloggers|lkl, a userland keylogger]] and of course the PIN typed into the beid graphical prompt could be easily captured.&lt;br /&gt;
* He gets physical access to your eID, even briefly if he has e.g. a PDA with Internet &amp;amp; smartcard reader.&lt;br /&gt;
* Now he can sign with your legal signature anything you can imagine... and you cannot repudiate what he does.&lt;br /&gt;
* The fact that maybe legal signatures have to be crafted through CertiPost (cf e-signing below) doesn&#039;t change anything to this risk.&lt;br /&gt;
&lt;br /&gt;
====So what will I do next time?====&lt;br /&gt;
* I&#039;ll probably accept the Authentication certificate to be able to play around with it.&lt;br /&gt;
* For sure I&#039;ll revoke the Signature certificate unless they change their architecture.&lt;br /&gt;
** Not the same PIN than the other certificate.&lt;br /&gt;
** Better than 4 digits (&amp;amp; 3 attempts so 3 chances over 10000)&lt;br /&gt;
** Probably they limited themselves to one single small PIN in order to pass the [http://www.kafka.be Kafka test] ;-)&lt;br /&gt;
** Even then:&lt;br /&gt;
*** Then I could use it but only on trusted devices, that&#039;s another story...&lt;br /&gt;
*** You get the PIN &amp;amp; PUK by post if I remember well, this could be eavesdropped but you can change your PIN... So  as the PUK can unlock the PIN 12 times, the attacker has 36 chances over 10000, one over 278, mmm... And who said humans can generate random PINs? ;-)&lt;br /&gt;
&lt;br /&gt;
===Privacy and other security considerations===&lt;br /&gt;
* [http://idcorner.org/2005/07/04/the-belgian-eid-card-calamity/ Another] [http://www.idcorner.org/?p=121 consideration] I didn&#039;t talk about yet: PRIVACY&lt;br /&gt;
* Whoever sees your public certificate (which happens e.g. if you log to a SSL website with your card or &#039;&#039;&#039;if you simply send a signed email&#039;&#039;&#039;) sees your [http://www.ibz.rrn.fgov.be/ RRN (&amp;quot;rijksregistratienummer&amp;quot;)]&amp;lt;br&amp;gt;BTW here is [http://fr.wikipedia.org/wiki/Num%C3%A9ro_de_registre_national how it&#039;s constructed]: It is a total of 11 numbers of which the first 6 are your birthdate JJMMDD followed by three numbers to distinguish the people that were born on the same day (even for men, uneven for women) and the last two numbers are a control number. So if you know the birthdate and the sex of the person, and you know how the control sum is done (97-JJMMDDXXX%97), you only miss two and a half numbers coming from a linear incremental counter (001, 003,...) to recompile his national register number. For mine it takes less than 40 attempts it you proceed logically...&lt;br /&gt;
* [http://minfin.fgov.be/taxonweb/ Tax-on-web] announce it but what about the others and your mail correspondants?&amp;lt;br&amp;gt;&#039;&#039;Suite à l&#039;utilisation de votre moyen d&#039;authentification (carte d&#039;identité électronique ou token citoyen), le SPF Finances a connaissance de votre numéro de registre national.&amp;lt;br&amp;gt;Conformément à l&#039;arrêté royal du 25/04/1986 autorisant certaines autorités du Ministère des Finances à utiliser le numéro d&#039;identification du registre national des personnes physiques, votre numéro de registre national n&#039;est utilisé dans ce contexte qu&#039;à des fins d&#039;identification pour l&#039;accès aux applications du SPF Finances.&amp;lt;br&amp;gt;La loi du 8 décembre 1992 relative à la protection de la vie privée à l&#039;égard des traitements de données à caractère personnel s&#039;applique à ce traitement d&#039;identification dont le responsable est le SPF Finances, Boulevard Albert II, 33 à 1030 Bruxelles.&#039;&#039;&lt;br /&gt;
* Other &amp;quot;funny&amp;quot; facts: Belgium government doesn&#039;t bother about cross-certification with any common Root CA so when you want to visit an official site supposedly secured such as  https://ccff02.minfin.fgov.be/CCFF_Authentication/choseLoginMethod.do or https://mijndossier.rrn.fgov.be you&#039;re kindly asked to blindly trust the certificate, years after phishing was invented, sigh...&lt;br /&gt;
* And even &amp;quot;better&amp;quot;: for Firefox, [http://www.certipost.be/dpsolutions/en/e-signing-faq.html CertiPost e-Signing] requires you to download and install their CA certificate and to trust it for identifying everything: web sites, mail users and software! Here the download of the CA certificate is done... on pure http, sigh...&lt;br /&gt;
* [https://www.cosic.esat.kuleuven.be/adapid/ ADAPID project] is a consortium of researchers and industry representatives in Flanders decided to take action in an attempt to help avoid a national privacy calamity. After a first (non-public) report, the ADAPID project won the financial support of IWT-Flanders. ADAPID officially started July 1st, 2005 and will run until June 30th, 2009.&lt;br /&gt;
* Normally the third and definitive version of the eID should have been rolled out begin of this year (2008) but I&#039;ve no idea what are the changes.&lt;br /&gt;
* [http://www.cirb.irisnet.be/site/fr/eid/ethicalid/index_htm Ethical-ID] is a software which presents to the e.g. swimming pool employee the only relevant data e.g. the residence city.&lt;br /&gt;
&lt;br /&gt;
==My attempts under Linux==&lt;br /&gt;
I&#039;m using the [[IDream ID-SMID01 SmartCard reader]], bought for 10€&lt;br /&gt;
&lt;br /&gt;
Installing beidgui and dependencies:&lt;br /&gt;
 apt-get install beidgui beid-tools&lt;br /&gt;
 =&amp;gt; libopenct1 libpcsclite1 libbeidlibopensc2 libbeid2 beid-tools beidgui libccid pcscd &lt;br /&gt;
 less /usr/share/doc/libbeidlibopensc2/README.Debian&lt;br /&gt;
&lt;br /&gt;
The GUI application works well, including OCSP communication, showing me that my eID certificates are revoked, excellent!&lt;br /&gt;
&lt;br /&gt;
UPDATE: There is a version 2.6.0-3 available in unstable&lt;br /&gt;
 apt-get install -t unstable beidgui beid-tools&lt;br /&gt;
&lt;br /&gt;
There are 2 (optional) daemons provided with beid-tools:&lt;br /&gt;
* beidcrld&amp;lt;br&amp;gt;Automatic CRL download&lt;br /&gt;
* beidpcscd&amp;lt;br&amp;gt;The privacy filter monitors all commands sent to the card. When an application requests to read the identity data, address or photo from the eID card, the filter will display a message and ask the user&#039;s consent&amp;lt;br&amp;gt;it&#039;s listening on port tcp 2500 and beidcrld, firefox-bin and icedove-bin are constantly speaking with it...&lt;br /&gt;
&lt;br /&gt;
===Exploring===&lt;br /&gt;
 pkcs15-tool --dump&lt;br /&gt;
 pkcs15-tool --read-certificate 02 &amp;gt; my_auth.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 03 &amp;gt; my_sign.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 04 &amp;gt; belgium.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 06 &amp;gt;&amp;gt; belgium.crt&lt;br /&gt;
 openssl x509 -in my_auth.crt -text&lt;br /&gt;
 pkcs15-tool --read-ssh-key 2&lt;br /&gt;
 # For a little demo...&lt;br /&gt;
 beid-pkcs11-tool --slot 0 --login --test&lt;br /&gt;
There is also some java support but I couldn&#039;t try it yet.&lt;br /&gt;
&lt;br /&gt;
===Firefox security module===&lt;br /&gt;
To add the security module to Firefox:&lt;br /&gt;
 apt-get install libbeid2-dev libbeidlibopensc2-dev&lt;br /&gt;
Visit file:///usr/share/beid/beid-pkcs11-register.html to install the service&lt;br /&gt;
&lt;br /&gt;
Now what?...&lt;br /&gt;
&amp;lt;br&amp;gt;cf http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/eID-FR-Firefox.pdf&lt;br /&gt;
&amp;lt;br&amp;gt;You can see your certificate in Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; View Certificates and you can trust the Belgium Root CA under the &amp;quot;Authorities&amp;quot; tab for e.g. &amp;quot;identifying mail users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can then connect to federal sites like [http://minfin.fgov.be/taxonweb/ Tax-on-web] or the [https://mondossier.rrn.fgov.be RRN], being identified by your card &amp;amp; PIN.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that it works only if I start Firefox after having the eID in place in the reader.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that I didn&#039;t get much further, being redirected to e.g.&lt;br /&gt;
this nonexistent page but the title speaks for itself ;-) https://mondossier.rrn.fgov.be/CertificateRevoked.html&lt;br /&gt;
&lt;br /&gt;
===Thunderbird security module===&lt;br /&gt;
To add the security module to Firefox:&lt;br /&gt;
 apt-get install libbeid2-dev libbeidlibopensc2-dev&lt;br /&gt;
Menu preferences-&amp;gt;advanced-&amp;gt;certificates-&amp;gt;security devices-&amp;gt;load&lt;br /&gt;
 Module name: Belgium Identity Card PKCS#11&lt;br /&gt;
 Module filename: /usr/lib/libbeidpkcs11.so&lt;br /&gt;
&lt;br /&gt;
You can see your certificate in Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; View Certificates and you can trust the Belgium Root CA under the &amp;quot;Authorities&amp;quot; tab for e.g. &amp;quot;identifying mail users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Try to sign a first mail:&lt;br /&gt;
&amp;lt;br&amp;gt;Menu S-MIME -&amp;gt; Digitally sign this message -&amp;gt; setup certificate -&amp;gt; digital signing -&amp;gt; select your BELPIC auth certif&lt;br /&gt;
&lt;br /&gt;
I could successfully sign (with my PIN) and verify an email but only with the Authentication certificate, not the Signature certificate&lt;br /&gt;
&amp;lt;br&amp;gt;According to the snapshots of the official guide of the eID for Outlook, it&#039;s ok, the Authentication certificate must be used, the other being reserved for legal signatures.&lt;br /&gt;
&amp;lt;br&amp;gt;UPDATE: Well now that I saw that Wouter could sign with the signature certificate I tried again and indeed it works.&lt;br /&gt;
&amp;lt;br&amp;gt;TODO: I still would like to understand what went wrong before, why only the &amp;quot;Authentication&amp;quot; certificate worked and not the &amp;quot;Signature&amp;quot; one.&lt;br /&gt;
&lt;br /&gt;
One difficulty is that the certificate is not bound to an email address so the email client tells you sth like it&#039;s validly signed but no idea if the certificate owner corresponds to the sender email address.&lt;br /&gt;
&lt;br /&gt;
===Signing with pkcs15-crypt===&lt;br /&gt;
From https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/UsingOpenscTOC#using_opensc_smartcards_to_sign&lt;br /&gt;
&lt;br /&gt;
Signing text and extracting the public certificate:&lt;br /&gt;
 fortune &amp;gt; data.txt&lt;br /&gt;
 openssl sha1 -binary data.txt &amp;gt; data.sha1&lt;br /&gt;
 pkcs15-crypt --key 2 --sign --pkcs1 --sha-1 --input data.sha1 --output data.auth.sig&lt;br /&gt;
 pkcs15-tool --read-certificate 02 &amp;gt; my_auth.crt&lt;br /&gt;
&lt;br /&gt;
Verifying the signature:&lt;br /&gt;
 openssl x509 -in my_auth.crt -pubkey -noout &amp;gt; my_auth.pem&lt;br /&gt;
 openssl dgst -sha1 -verify my_auth.pem -signature data.auth.sig data.txt&lt;br /&gt;
&lt;br /&gt;
I tried to do the same with the signature certificate instead of the authentication certificate but I get an error:&lt;br /&gt;
 pkcs15-crypt --key 3 --sign --pkcs1 --sha-1 --input data.sha1 --output data.auth.sig&lt;br /&gt;
 [pkcs15-crypt] sec.c:67:sc_set_security_env: returning with: Not supported&lt;br /&gt;
 [pkcs15-crypt] pkcs15-sec.c:267:sc_pkcs15_compute_signature: sc_set_security_env() failed: Not supported&lt;br /&gt;
 Compute signature failed: Not supported&lt;br /&gt;
Indeed signing with the signature certificate and without a GUI showing a warning about the legal implication is forbidden.&lt;br /&gt;
&lt;br /&gt;
===Signing with GpgSM===&lt;br /&gt;
GpgSM is to X.509 what GnuPG is to OpenPGP, cf http://gnupg.org/aegypten/tech.en.html&lt;br /&gt;
&lt;br /&gt;
 apt-get install gpgsm dirmngr gnupg-agent pinentry-qt&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/gpg-agent.conf:&lt;br /&gt;
 no-grab&lt;br /&gt;
 default-cache-ttl 1800&lt;br /&gt;
 ignore-cache-for-signing&lt;br /&gt;
 allow-mark-trusted&lt;br /&gt;
&lt;br /&gt;
 ~/.bash_profile: (appending this stuff)&lt;br /&gt;
 # preparing gpg-agent:&lt;br /&gt;
 if test -f $HOME/.gpg-agent-info &amp;amp;&amp;amp; kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2&amp;gt;/dev/null; then&lt;br /&gt;
   GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info`&lt;br /&gt;
   export GPG_AGENT_INFO&lt;br /&gt;
 else&lt;br /&gt;
   eval `gpg-agent --daemon`&lt;br /&gt;
   echo $GPG_AGENT_INFO &amp;gt;$HOME/.gpg-agent-info&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/scdaemon.conf: (we disable internal CCID support as only libccid supports more or less my crappy reader)&lt;br /&gt;
 disable-ccid&lt;br /&gt;
 debug-level none&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/gpgsm.conf:&lt;br /&gt;
 debug-level none&lt;br /&gt;
&lt;br /&gt;
Acquiring the certificates:&lt;br /&gt;
 $ gpgsm --learn-card&lt;br /&gt;
Actually I had to run it several times, the first time only the Belgium CA was extracted, then the Citizen CA and finally the 2 personal certificates. And the behavior is not really reproductible so you&#039;ve to run it till you&#039;ve the 4 certificates:&lt;br /&gt;
 $ gpgsm --list-keys&lt;br /&gt;
 /home/phil/.gnupg/pubring.kbx&lt;br /&gt;
 -----------------------------&lt;br /&gt;
      Subject: /CN=Belgium Root CA/C=BE&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Citizen CA/C=BE/SerialNumber=200507&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Philippe Teuwen (Authentication)/C=BE/SerialNumber=...&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Philippe Teuwen (Signature)/C=BE/SerialNumber=...&lt;br /&gt;
To sign sth:&lt;br /&gt;
 $ gpgsm --sign mail.txt&lt;br /&gt;
Then I get prompted to trust Belgium CA and gpgsm fails &amp;quot;error creating signature: Certificat révoqué &amp;lt;GpgSM&amp;gt;&amp;quot;, normal.&lt;br /&gt;
&amp;lt;br&amp;gt;During trusting the Belgium CA, it created automatically a .gnupg/trustlist.txt with&lt;br /&gt;
 # CN=Belgium Root CA,C=BE&lt;br /&gt;
 DF:DF:AC:89:47:BD:F7:52:64:A9:23:3A:C1:0E:E3:D1:28:33:DA:CC S&lt;br /&gt;
&lt;br /&gt;
Ok let&#039;s try again without the CRLs check:&lt;br /&gt;
 $ gpgsm --disable-crl-checks --armor --sign --output mail.txt.smime mail.txt&lt;br /&gt;
 [...]&lt;br /&gt;
 gpgsm: signature created&lt;br /&gt;
I was prompted for my PIN during the process.&lt;br /&gt;
&lt;br /&gt;
And trying to verify, with CRLs:&lt;br /&gt;
 $ gpgsm --verify --output mail.txt mail.txt.smime&lt;br /&gt;
 gpgsm: Signature made 2008-02-06 21:42:40 using certificate ID 0x80211056&lt;br /&gt;
 gpgsm: note: non-critical certificate policy not allowed&lt;br /&gt;
 dirmngr[8994]: error opening `/home/phil/.gnupg/dirmngr_ldapservers.conf&#039;: Aucun fichier ou répertoire de ce type&lt;br /&gt;
 dirmngr[8994]: permanently loaded certificates: 0&lt;br /&gt;
 dirmngr[8994]:     runtime cached certificates: 0&lt;br /&gt;
 dirmngr[8994]: command ISVALID failed: Certificat révoqué&lt;br /&gt;
 gpgsm: certificate #100000000000E144CBC42E9BB2453EE4/2.5.4.5=#323030353037,CN=Citizen CA,C=BE&lt;br /&gt;
 gpgsm: certificate has been revoked&lt;br /&gt;
 gpgsm: invalid certification chain: Certificat révoqué&lt;br /&gt;
And without CRLs:&lt;br /&gt;
 $ gpgsm --disable-crl-checks --verify --output mail.txt mail.txt.smime          &lt;br /&gt;
 gpgsm: Signature made 2008-02-06 21:42:40 using certificate ID 0x80211056&lt;br /&gt;
 gpgsm: CRLs not checked due to --disable-crl-checks option&lt;br /&gt;
 gpgsm: Good signature from &amp;quot;/CN=Philippe Teuwen (Authentication)/C=BE/SerialNumber=...&lt;br /&gt;
&lt;br /&gt;
===e-Signing plugin for Firefox===&lt;br /&gt;
* pure curiosity...&lt;br /&gt;
* cf http://www.certipost.be/dpsolutions/en/e-signing-faq.html&lt;br /&gt;
* the plugin is signed so you&#039;ve to install the CA certificate of Certipost first and, cf above in my &amp;quot;funny facts&amp;quot;, for Firefox, you&#039;ve to download and... trust it.&amp;lt;br&amp;gt;The certificate is apparently no longer (broken link) and I could not find it in their search tool, the only thing I could find is [http://64.233.183.104/search?q=cache:vzHK3UKTuiMJ:www.certipost.be/en/certificates/PrimaryNormalisedCA/certificate_pem.cer+PrimaryNormalisedCA&amp;amp;hl=fr&amp;amp;ct=clnk&amp;amp;cd=3&amp;amp;gl=fr a copy of the pem version in Google cache(!)]&amp;lt;br&amp;gt;but that was good enough to be able to install the plugin.&lt;br /&gt;
* Moreover [https://connect.e-signing.be/app/en/create the form to sign] wants to directly execute some jar file but under an SSL connection signed by... the so-hard-to-get Certipost CA certificate, itself signed by GTE CyberTrust Global Root, an authority built-in in the browsers.&lt;br /&gt;
* You&#039;ve [https://www.certipost.be/webshop/ to pay] to be able to sign with your eID non-repudiation signature to have a valid &#039;&#039;Qualified Electronic Signature with long term value&#039;&#039;&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/images/stories/e-signing/right/technical_measures_en.pdf There are some explanations] of the additional services provided by CertiPost:&amp;lt;br&amp;gt;&#039;&#039;The applied XAdES-X-L is an XML signature format according to the recognized XAdES standard (ETSI TS 101 903 standard) that implements measures to satisfy the legal requirements for advanced electronic signatures as defined in the European Directive (EC 1999/93: European Community (EC) DIRECTIVE 1999/93/EC OF THE EUROPEAN PARLIAMENT AND COUNCIL ON A COMMUNITY FRAMEWORK FOR ELECTRONIC SIGNATURES) and for long term non-repudiation. Next to the electronic signature itself, the XAdES-X-Lfile contains the certificate that was used during the signature, the information to proof whether the certificate was valid when signing, and a time stamp to proof that all information used for signing existed and not altered since.&amp;lt;br&amp;gt;Moreover CertiPost keeps a copy of the signed information.&lt;br /&gt;
* Timestamps &amp;amp; storage look like additional features, not mandated by the law, so can I create a &#039;&#039;Qualified Electronic Signature with long term value&#039;&#039; out of the CertiPost context, so just a plain x509 signature?&lt;br /&gt;
&lt;br /&gt;
===SSH===&lt;br /&gt;
Inspired from http://simi.be/?page_id=9&lt;br /&gt;
&lt;br /&gt;
Getting the patch from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=355274 and porting it to v4.7p1&lt;br /&gt;
&amp;lt;br&amp;gt;Some rejs easy to solve from v4.2 to v4.7 and one less obvious change in debian/control: fix the debconf dependancies (was ${debconf:Depends} I think):&lt;br /&gt;
 Package: openssh-client-sc                                                          &lt;br /&gt;
 Architecture: any                                                                   &lt;br /&gt;
 Depends: ${shlibs:Depends}, debconf (&amp;gt;= 1.2.0) | debconf-2.0,...&lt;br /&gt;
&amp;lt;br&amp;gt;I recompile ssh with smartcard support.&lt;br /&gt;
 apt-get source openssh-client&lt;br /&gt;
 cd openssh-4.7p1&lt;br /&gt;
 patch -p1 &amp;lt; ../mypatch&lt;br /&gt;
 dpkg-buildpackage -uc -us -rfakeroot&lt;br /&gt;
Sending my public key to the ssh server:&lt;br /&gt;
 pkcs15-tool --read-ssh-key 2 |tail -n1|ssh user@host &#039;cat - &amp;gt;&amp;gt; ~/.ssh/authorized_keys&#039;&lt;br /&gt;
Then logging, being prompted for my PIN:&lt;br /&gt;
 ssh -I 0 user@host.com&lt;br /&gt;
===OpenID===&lt;br /&gt;
cf [[OpenID]] and [[OpenID-eID]] where I&#039;m hacking phpMyID to make my own&lt;br /&gt;
&lt;br /&gt;
===TODO: Login===&lt;br /&gt;
I tried https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/UsingOpenscTOC#logging_in_with_smartcards&lt;br /&gt;
but with the eID.&lt;br /&gt;
 apt-get install libpam-p11&lt;br /&gt;
See file:///usr/share/doc/libpam-p11/QuickStart.html&lt;br /&gt;
&amp;lt;br&amp;gt;Bad side: it conflicts with xlockmore :-(&lt;br /&gt;
&lt;br /&gt;
openssh way:&lt;br /&gt;
&amp;lt;br&amp;gt;Preparing the account with .ssh/authorized_keys, cf SSH auth on this page&lt;br /&gt;
&amp;lt;br&amp;gt;Edit /etc/pam.d/login and add before &amp;quot;@include common-auth&amp;quot; sth like:&lt;br /&gt;
 auth sufficient pam_p11_openssh.so /usr/lib/opensc-pkcs11.so&lt;br /&gt;
/var/log/auth.log tells: no certificates found&lt;br /&gt;
or&lt;br /&gt;
 auth sufficient pam_p11_openssh.so /usr/lib/libbeidpkcs11.so&lt;br /&gt;
/var/log/auth.log tells: fatal: pkcs11_sign failed &lt;br /&gt;
&amp;lt;br&amp;gt;before I was even prompted for my PIN&lt;br /&gt;
&lt;br /&gt;
opensc way: same results&lt;br /&gt;
 auth sufficient pam_p11_opensc.so /usr/lib/opensc-pkcs11.so&lt;br /&gt;
 auth sufficient pam_p11_opensc.so /usr/lib/libbeidpkcs11.so&lt;br /&gt;
preparing the account:&lt;br /&gt;
 mkdir ~/.eid&lt;br /&gt;
 chmod 0755 ~/.eid&lt;br /&gt;
 pkcs15-tool -r 2 &amp;gt; ~/.eid/authorized_certificates&lt;br /&gt;
 chmod 0644 ~/.eid/authorized_certificates&lt;br /&gt;
&lt;br /&gt;
So I still couldn&#039;t find a way.&lt;br /&gt;
&lt;br /&gt;
===TODO: SSL Auth===&lt;br /&gt;
http://blog.eikke.com/index.php/ikke/2007/10/29/using_your_belgian_eid_for_ssl_authentic&lt;br /&gt;
&lt;br /&gt;
 apt-get install libengine-pkcs11-openssl&lt;br /&gt;
&lt;br /&gt;
To generate a request, open a console and launch openssl. Once at the OpenSSL prompt, issue these 2 commands:&lt;br /&gt;
 engine -t dynamic -pre SO_PATH:/usr/lib/engines/engine_pkcs11.so -pre ID:pkcs11 -pre LIST_ADD:1 -pre LOAD -pre MODULE_PATH:/usr/lib/opensc-pkcs11.so&lt;br /&gt;
Adjust paths if necessary, of course. This loads the pkcs11 engine inside OpenSSL.&lt;br /&gt;
 req -engine pkcs11 -new -days 100 -key id_02 -keyform engine -out myrequest.csr -subj &amp;quot;/C=BE/ST=O-VL/O=My Organisation/CN=My Name/emailAddress=my@email.tld&amp;quot;&lt;br /&gt;
Adjust the days, out and subj parameters, at least. The key ID can be found using&lt;br /&gt;
 pkcs15-tool -c&lt;br /&gt;
Use the ID of the Authentication X509 certificate.&lt;br /&gt;
&lt;br /&gt;
===TODO: Apache SSL Reverse Proxy===&lt;br /&gt;
cf http://www.belgium.be/zip/eid_authentication_proxy_fr.html&lt;br /&gt;
===TODO: OpenGPG &amp;amp; x509===&lt;br /&gt;
Old dream is to sign an OpenPGP key with the eID, but even if technically possible, it probably breaks the validation chain as what Citizen CA signed was the entire certificate, not just the key/uid.&lt;br /&gt;
&amp;lt;br&amp;gt;Sth to check: [http://www.imc.org/ietf-openpgp/mail-archive/msg09930.html OpenPGP Signatures Incorporating X.509 Certificates]&lt;br /&gt;
&amp;lt;br&amp;gt;The solution is apparently to extend OpenGPG to allow special signatures on UIDs with sub-packets containing the entire certificate, the UID being build from the DN fields of the certificate (CN, EMAIL,...)&lt;br /&gt;
&amp;lt;br&amp;gt;Apparently PGP supports it already?&lt;br /&gt;
&lt;br /&gt;
===TODO: OpenVPN Auth===&lt;br /&gt;
http://christophe.vandeplas.com/2008/02/03/openvpn-belgian-eid&lt;br /&gt;
&amp;lt;br&amp;gt;But Debian openvpn 2.1_cr4 doesn&#039;t support yet --show-pkcs11-ids&lt;br /&gt;
===TODO: Other tools===&lt;br /&gt;
* [http://sourceforge.net/projects/opensignature OpenSignature] for Italia&lt;br /&gt;
* [http://openportalguard.sourceforge.net/ Open Portal Guard] for e.g. public administrations&lt;br /&gt;
* beidcrld: where are CRLs downloaded to?&lt;br /&gt;
* beidpcscd: how to test it?&lt;br /&gt;
* beidlib.jar: BEIDCard.html and Test.java&lt;br /&gt;
* Novell version in C#...&lt;br /&gt;
** I could compile but still runtime errors&lt;br /&gt;
** Support in OpenOffice? check the shell script&lt;/div&gt;</summary>
		<author><name>212.71.5.64</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=2945</id>
		<title>Belgian eID</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=2945"/>
		<updated>2008-03-05T07:46:14Z</updated>

		<summary type="html">&lt;p&gt;212.71.5.64: /* TODO: Other tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Belgian eID is part of the efforts of the government for [[Belgian eGov]]&lt;br /&gt;
==Officials==&lt;br /&gt;
&lt;br /&gt;
* [http://eid.belgium.be Official eID portal]&lt;br /&gt;
* [http://repository.eid.belgium.be/FR/Index.htm Certificates]&lt;br /&gt;
* [http://status.eid.belgium.be/ eID services]&lt;br /&gt;
* [http://crl.eid.belgium.be/ Revocation lists] and [http://ocsp.eid.belgium.be/ OCSP server]&lt;br /&gt;
* [http://eid.belgium.be/fr/navigation/documents/37129.html Circulaires (fr) eID Home  /  Villes et communes  /  Quoi  /  Circulaires]&amp;lt;br&amp;gt;Among others:&amp;lt;br&amp;gt; 3) FORMULAIRE DE RENONCIATION AUX CERTIFICATS DE LA CARTE D’IDENTITE ELECTRONIQUE AU MOMENT DE LA DEMANDE DE LA CARTE&amp;lt;br&amp;gt;10) MODELE D’ATTESTATION D’ACTIVATION OU DE REVOCATION DES CERTIFICATS APRES ACTIVATION DE LA CARTE&amp;lt;br&amp;gt;11) MODELE D’ATTESTATION DE SUSPENSION ET DE REACTIVATION DES CERTIFICATS&lt;br /&gt;
* [http://www.certipost.be CertiPost], by Belgacom &amp;amp; La Poste/De Post&lt;br /&gt;
** [http://www.certipost.be/x500/X500.html Certipost E-Trust™ Public X500 Directory Search]&lt;br /&gt;
&lt;br /&gt;
==Usage &amp;amp; Software==&lt;br /&gt;
&lt;br /&gt;
* [http://www.belgium.be/zip/eid_datacapture_fr.html Middleware &amp;amp; developer&#039;s kit]&lt;br /&gt;
** There are also Debian packages, cf below my tests under Linux&lt;br /&gt;
** [http://developer.novell.com/wiki/index.php/EID-belgium eID configuration toolkit by Novell]&lt;br /&gt;
* [http://homes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/WebHome Danny De Cock&#039;s page on eID] (same as http://www.godot.be)&lt;br /&gt;
* [http://weblogs.asp.net/cumpsd/archive/2005/04/03/396900.aspx short intro]&lt;br /&gt;
* [http://weblogs.asp.net/cumpsd/archive/2005/04/03/396901.aspx how to use the eID card within your .NET apps]&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
* http://www.foo.be/eID/ Official data, spec sheet etc (outdated)&lt;br /&gt;
* [http://belsec.skynetblogs.be/tag/1/E-ID Belsec blog entries] about the eID&lt;br /&gt;
* [http://www.uvcw.be/no_index/e-communes/dossier_eid/Belgian_eID_Run-time_Users_guide.pdf Belgian E-ID runtime guide windows/linux pdf]&lt;br /&gt;
* [http://www.porvoo8.rrn.fgov.be/porvoo8/doc13/09_porvoo8-bruegger18_Italy.pdf Open source interoperability and E-ID pdf]&lt;br /&gt;
* [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/5%20aspects%20techniques/fr/belpic_eid_version_numbering_v1.5.2.pdf The versioning of E-ID pdf]&lt;br /&gt;
* [http://porvoo10.net/p10/10_porvoo10-bud-25.pdf The road to European E-ID interoperability pdf]&lt;br /&gt;
* [http://www.microsoft.com/belux/nl/eid/ Microsoft and the eID], just an old marketing buzz? (I wouldn&#039;t complain...)&lt;br /&gt;
* [http://samba.grep.be/~wouter/beid-screencast.ogg], BeID screencast of what should have been shown at Fosdem 2008, by Wouter. (still waiting for the video of the presentation...)&lt;br /&gt;
* [http://www.lalibre.be/societe/cyber/article/404626/la-carte-d-identite-electronique-permettra-de-s-enregistrer-sur-ebay.html] La carte d&#039;identité électronique permettra de s&#039;enregistrer sur eBay&lt;br /&gt;
&lt;br /&gt;
==I revoked my certificates==&lt;br /&gt;
===Why?===&lt;br /&gt;
Because at that time I knew too few on the details of the eID architecture and too much about how a new security architecture can have flaws, so better to stay away for a while, especially given the legal implications that the eID can bring.&amp;lt;br&amp;gt;I knew they were talking about two certificates without understanding their difference, so let&#039;s revoke both.&amp;lt;br&amp;gt;Note that it doesn&#039;t mean my eID is not valid, eID card activation is mandatory. The eID card is a proof of identity and residence of a person in Belgium. eID certificates activation is a choice of the holder of the eID (opt-in), he/she can decide to activate or revoke the certificates. (cf [http://www.certipost.be/dpsolutions/en/eid-faq.html FAQ])&lt;br /&gt;
===How?===&lt;br /&gt;
It was quite epic.&lt;br /&gt;
&amp;lt;br&amp;gt;I was still a bit prepared, hopefully, so I had printed the Annexes 3 &amp;amp; 10, the legal forms to ask either to renounce to have the certificates or to revoke them just after activation, as well as the relevant parts of the User Manual for the civil servants :-)&lt;br /&gt;
&amp;lt;br&amp;gt;I printed both as for me it was not clear from the User Manual how to renounce for the certificates.&lt;br /&gt;
* [Me] Good morning, I come for my eID and... I want to get rid of the certificates&lt;br /&gt;
* [Her] You what? Is it possible? Never heard about that&lt;br /&gt;
* [Me] Yes, yes, see (and I show her what&#039;s in her User Manual)&lt;br /&gt;
* ... (takes a while to digest the info)&lt;br /&gt;
* [Her] Ha ok, you&#039;ve to fill Annex 3, (shouting behind her shoulder) JOSETTE, DO WE HAVE ANNEX 3???&lt;br /&gt;
* [Josette] ANNEX WHAT??&lt;br /&gt;
* [Me] No prob, look (and I pull out my own copy of [http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/03_-_FORMULAIRE_RENONCIATION_CERTIFS.pdf Annex 3 (pdf)])&lt;br /&gt;
* ... (meanwhile she has no idea what to do on the eID to fulfill renouncement and I agree with her, the Manual was unclear so we went for activation+revocation)&lt;br /&gt;
* [Me] No prob, look (and I pull out my own copy of [http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/10_-_Attestation_activ_Certificats(18-10)_27-07.pdf Annex 10 (pdf)])&lt;br /&gt;
* [Her] Can I take your copies before you fill them? I&#039;ll make copies for ourselves.&lt;br /&gt;
So today the official Annex 3&amp;amp;10 forms of this civil office are mine :-D&amp;lt;br&amp;gt;Who knows, maybe I crafted the form... ;-)&lt;br /&gt;
&lt;br /&gt;
It is &amp;quot;funny&amp;quot; to see that everywhere the activation of the certificates is presented as optional, the choice being left to the citizen, blablabla, but in reality most of the citizen just don&#039;t know about this possibility (and most of the civil servants, well I hope that since my story, things have evolved a bit) and the civil servants doesn&#039;t ask you the question.&lt;br /&gt;
&lt;br /&gt;
===Some details about those certificates===&lt;br /&gt;
The eID contains 2 signature certificates, so you cannot encrypt with them, just sign.&lt;br /&gt;
* One labeled &amp;quot;Authentication&amp;quot; is for daily use &lt;br /&gt;
** To log in on SSL websites such as [http://minfin.fgov.be/taxonweb/ Tax-on-web] or [http://www.saferchat.be SaferChat] or even your bank e.g. [http://www.keytradebank.com/pdf/eID_en.pdf Keytrade has implemented it (pdf)] with CRL check&lt;br /&gt;
** For signing mails with S/MIME&lt;br /&gt;
** For your own purpose, to log on your SSH server, SSL server, VPN etc&lt;br /&gt;
* One labeled &amp;quot;Signature&amp;quot; is for special cases&lt;br /&gt;
** It has a equivalent legal value as a hand-written signature and is referred as non-repudiation signature.&lt;br /&gt;
** According to [http://www.certipost.be/dpsolutions/images/stories/e-signing/right/applicability_en.pdf CertiPost applicability guidelines (pdf)], the electronic signature still cannot replace a hand-written signature in a number of cases&lt;br /&gt;
**It&#039;s automatically revoked for minors under 18 years as they cannot sign legally yet.&lt;br /&gt;
**From [http://www.certipost.be/dpsolutions/en/eid-faq.html Certipost FAQ]:&amp;lt;br&amp;gt;&#039;&#039;Non-repudiation guarantees that one cannot deny having performed an act. E.g. any message signed using a person&#039;s digital signature can only have come from this person. The signing person can not claim that the message was not originated by him.&amp;lt;br&amp;gt;In other words, non-repudiation means that information &#039;&#039;&#039;cannot be disclaimed&#039;&#039;&#039;, similar to a &#039;&#039;&#039;witnessed&#039;&#039;&#039; handwritten signature on a paper document.&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;to be checked in the law&#039;&#039;&lt;br /&gt;
** Normal pkcs software doesn&#039;t seem to be able to use it (?)&lt;br /&gt;
** Should be used only through the Government software which prompts you with a special GUI and warnings about the legal power of this signature&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/en/rem-overzicht.html CertiPost e-Registered mails] is using the non-repudiation signature&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/en/e-signing-overview.html CertiPost e-Signing] is using the non-repudiation signature&lt;br /&gt;
* Both are protected by the same PIN which is typed on your (unsafe) PC&lt;br /&gt;
&lt;br /&gt;
===What says the law===&lt;br /&gt;
Sorry, here are french version abstracts.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;9 JUILLET 2001. - Loi fixant certaines règles relatives au cadre juridique pour les signatures électroniques et les services de certification&#039;&#039;&#039;, date de publication au Moniteur: 29 septembre 2001&lt;br /&gt;
&amp;lt;br&amp;gt;Morceaux choisis:&lt;br /&gt;
* Art. 4. § 1er. A défaut de dispositions légales contraires, nul ne peut être contraint de poser un acte juridique par voie électronique.&lt;br /&gt;
* § 4. Sans préjudice des articles 1323 et suivants du Code civil, une signature électronique avancée réalisée sur la base d&#039;un certificat qualifié et conçue au moyen d&#039;un dispositif sécurisé de création de signature électronique, est assimilée à une signature manuscrite, qu&#039;elle soit réalisée par une personne physique ou morale.&lt;br /&gt;
* § 5. Une signature électronique ne peut être privée de son efficacité juridique et ne peut être refusée comme preuve en justice au seul motif :&lt;br /&gt;
** que la signature se présente sous forme électronique, ou&lt;br /&gt;
** qu&#039;elle ne repose pas sur un certificat qualifié, ou&lt;br /&gt;
** qu&#039;elle ne repose pas sur un certificat qualifié délivré par un prestataire accrédité de service de certification, ou&lt;br /&gt;
** qu&#039;elle n&#039;est pas créée par un dispositif sécurisé de création de signature.&lt;br /&gt;
* &#039;&#039;Wait a minute, ANY electronic signature NOT being based on a qualified certificate and NOT created in a secure environment CANNOT be refused as a legal proof???&amp;lt;br&amp;gt;Maybe it&#039;s me or the triple-negation sentences (lawyers, lawyers...) but it looks like § 5 goes much further than § 4&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===What do I think today?===&lt;br /&gt;
====Catastrophe scenario==== &lt;br /&gt;
* Someone captures your PIN while you&#039;re using it for &amp;quot;just authentication&amp;quot; via e.g. malware, virus, trojan, worm on the PC &lt;br /&gt;
** you know, the kind of stuff that never happens, anyway it&#039;s now [http://eid.belgium.be/fr/navigation/documents/39814.html your problem] even if the official middleware [http://blog.didierstevens.com/2007/12/31/how-can-i-trust-the-beid-runtime/ is not signed]&lt;br /&gt;
**And apparently even some readers with integrated keypads are [http://belsec.skynetblogs.be/post/5426553/belgian-eid-nr-11--keyloggers-work-with-eid not safer :-(]&lt;br /&gt;
**And apparently even commercial standalone smatcard terminals are [http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-711.pdf not safer :-( (pdf)]&lt;br /&gt;
**And, oh, I did a small test with [[Keyloggers|lkl, a userland keylogger]] and of course the PIN typed into the beid graphical prompt could be easily captured.&lt;br /&gt;
* He gets physical access to your eID, even briefly if he has e.g. a PDA with Internet &amp;amp; smartcard reader.&lt;br /&gt;
* Now he can sign with your legal signature anything you can imagine... and you cannot repudiate what he does.&lt;br /&gt;
* The fact that maybe legal signatures have to be crafted through CertiPost (cf e-signing below) doesn&#039;t change anything to this risk.&lt;br /&gt;
&lt;br /&gt;
====So what will I do next time?====&lt;br /&gt;
* I&#039;ll probably accept the Authentication certificate to be able to play around with it.&lt;br /&gt;
* For sure I&#039;ll revoke the Signature certificate unless they change their architecture.&lt;br /&gt;
** Not the same PIN than the other certificate.&lt;br /&gt;
** Better than 4 digits (&amp;amp; 3 attempts so 3 chances over 10000)&lt;br /&gt;
** Probably they limited themselves to one single small PIN in order to pass the [http://www.kafka.be Kafka test] ;-)&lt;br /&gt;
** Even then:&lt;br /&gt;
*** Then I could use it but only on trusted devices, that&#039;s another story...&lt;br /&gt;
*** You get the PIN &amp;amp; PUK by post if I remember well, this could be eavesdropped but you can change your PIN... So  as the PUK can unlock the PIN 12 times, the attacker has 36 chances over 10000, one over 278, mmm... And who said humans can generate random PINs? ;-)&lt;br /&gt;
&lt;br /&gt;
===Privacy and other security considerations===&lt;br /&gt;
* [http://idcorner.org/2005/07/04/the-belgian-eid-card-calamity/ Another] [http://www.idcorner.org/?p=121 consideration] I didn&#039;t talk about yet: PRIVACY&lt;br /&gt;
* Whoever sees your public certificate (which happens e.g. if you log to a SSL website with your card or &#039;&#039;&#039;if you simply send a signed email&#039;&#039;&#039;) sees your [http://www.ibz.rrn.fgov.be/ RRN (&amp;quot;rijksregistratienummer&amp;quot;)]&amp;lt;br&amp;gt;BTW here is [http://fr.wikipedia.org/wiki/Num%C3%A9ro_de_registre_national how it&#039;s constructed]: It is a total of 11 numbers of which the first 6 are your birthdate JJMMDD followed by three numbers to distinguish the people that were born on the same day (even for men, uneven for women) and the last two numbers are a control number. So if you know the birthdate and the sex of the person, and you know how the control sum is done (97-JJMMDDXXX%97), you only miss two and a half numbers coming from a linear incremental counter (001, 003,...) to recompile his national register number. For mine it takes less than 40 attempts it you proceed logically...&lt;br /&gt;
* [http://minfin.fgov.be/taxonweb/ Tax-on-web] announce it but what about the others and your mail correspondants?&amp;lt;br&amp;gt;&#039;&#039;Suite à l&#039;utilisation de votre moyen d&#039;authentification (carte d&#039;identité électronique ou token citoyen), le SPF Finances a connaissance de votre numéro de registre national.&amp;lt;br&amp;gt;Conformément à l&#039;arrêté royal du 25/04/1986 autorisant certaines autorités du Ministère des Finances à utiliser le numéro d&#039;identification du registre national des personnes physiques, votre numéro de registre national n&#039;est utilisé dans ce contexte qu&#039;à des fins d&#039;identification pour l&#039;accès aux applications du SPF Finances.&amp;lt;br&amp;gt;La loi du 8 décembre 1992 relative à la protection de la vie privée à l&#039;égard des traitements de données à caractère personnel s&#039;applique à ce traitement d&#039;identification dont le responsable est le SPF Finances, Boulevard Albert II, 33 à 1030 Bruxelles.&#039;&#039;&lt;br /&gt;
* Other &amp;quot;funny&amp;quot; facts: Belgium government doesn&#039;t bother about cross-certification with any common Root CA so when you want to visit an official site supposedly secured such as  https://ccff02.minfin.fgov.be/CCFF_Authentication/choseLoginMethod.do or https://mijndossier.rrn.fgov.be you&#039;re kindly asked to blindly trust the certificate, years after phishing was invented, sigh...&lt;br /&gt;
* And even &amp;quot;better&amp;quot;: for Firefox, [http://www.certipost.be/dpsolutions/en/e-signing-faq.html CertiPost e-Signing] requires you to download and install their CA certificate and to trust it for identifying everything: web sites, mail users and software! Here the download of the CA certificate is done... on pure http, sigh...&lt;br /&gt;
* [https://www.cosic.esat.kuleuven.be/adapid/ ADAPID project] is a consortium of researchers and industry representatives in Flanders decided to take action in an attempt to help avoid a national privacy calamity. After a first (non-public) report, the ADAPID project won the financial support of IWT-Flanders. ADAPID officially started July 1st, 2005 and will run until June 30th, 2009.&lt;br /&gt;
* Normally the third and definitive version of the eID should have been rolled out begin of this year (2008) but I&#039;ve no idea what are the changes.&lt;br /&gt;
* [http://www.cirb.irisnet.be/site/fr/eid/ethicalid/index_htm Ethical-ID] is a software which presents to the e.g. swimming pool employee the only relevant data e.g. the residence city.&lt;br /&gt;
&lt;br /&gt;
==My attempts under Linux==&lt;br /&gt;
I&#039;m using the [[IDream ID-SMID01 SmartCard reader]], bought for 10€&lt;br /&gt;
&lt;br /&gt;
Installing beidgui and dependencies:&lt;br /&gt;
 apt-get install beidgui beid-tools&lt;br /&gt;
 =&amp;gt; libopenct1 libpcsclite1 libbeidlibopensc2 libbeid2 beid-tools beidgui libccid pcscd &lt;br /&gt;
 less /usr/share/doc/libbeidlibopensc2/README.Debian&lt;br /&gt;
&lt;br /&gt;
The GUI application works well, including OCSP communication, showing me that my eID certificates are revoked, excellent!&lt;br /&gt;
&lt;br /&gt;
UPDATE: There is a version 2.6.0-3 available in unstable&lt;br /&gt;
 apt-get install -t unstable beidgui beid-tools&lt;br /&gt;
&lt;br /&gt;
There are 2 (optional) daemons provided with beid-tools:&lt;br /&gt;
* beidcrld&amp;lt;br&amp;gt;Automatic CRL download&lt;br /&gt;
* beidpcscd&amp;lt;br&amp;gt;The privacy filter monitors all commands sent to the card. When an application requests to read the identity data, address or photo from the eID card, the filter will display a message and ask the user&#039;s consent&amp;lt;br&amp;gt;it&#039;s listening on port tcp 2500 and beidcrld, firefox-bin and icedove-bin are constantly speaking with it...&lt;br /&gt;
&lt;br /&gt;
===Exploring===&lt;br /&gt;
 pkcs15-tool --dump&lt;br /&gt;
 pkcs15-tool --read-certificate 02 &amp;gt; my_auth.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 03 &amp;gt; my_sign.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 04 &amp;gt; belgium.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 06 &amp;gt;&amp;gt; belgium.crt&lt;br /&gt;
 openssl x509 -in my_auth.crt -text&lt;br /&gt;
 pkcs15-tool --read-ssh-key 2&lt;br /&gt;
 # For a little demo...&lt;br /&gt;
 beid-pkcs11-tool --slot 0 --login --test&lt;br /&gt;
There is also some java support but I couldn&#039;t try it yet.&lt;br /&gt;
&lt;br /&gt;
===Firefox security module===&lt;br /&gt;
To add the security module to Firefox:&lt;br /&gt;
 apt-get install libbeid2-dev libbeidlibopensc2-dev&lt;br /&gt;
Visit file:///usr/share/beid/beid-pkcs11-register.html to install the service&lt;br /&gt;
&lt;br /&gt;
Now what?...&lt;br /&gt;
&amp;lt;br&amp;gt;cf http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/eID-FR-Firefox.pdf&lt;br /&gt;
&amp;lt;br&amp;gt;You can see your certificate in Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; View Certificates and you can trust the Belgium Root CA under the &amp;quot;Authorities&amp;quot; tab for e.g. &amp;quot;identifying mail users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can then connect to federal sites like [http://minfin.fgov.be/taxonweb/ Tax-on-web] or the [https://mondossier.rrn.fgov.be RRN], being identified by your card &amp;amp; PIN.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that it works only if I start Firefox after having the eID in place in the reader.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that I didn&#039;t get much further, being redirected to e.g.&lt;br /&gt;
this nonexistent page but the title speaks for itself ;-) https://mondossier.rrn.fgov.be/CertificateRevoked.html&lt;br /&gt;
&lt;br /&gt;
===Thunderbird security module===&lt;br /&gt;
To add the security module to Firefox:&lt;br /&gt;
 apt-get install libbeid2-dev libbeidlibopensc2-dev&lt;br /&gt;
Menu preferences-&amp;gt;advanced-&amp;gt;certificates-&amp;gt;security devices-&amp;gt;load&lt;br /&gt;
 Module name: Belgium Identity Card PKCS#11&lt;br /&gt;
 Module filename: /usr/lib/libbeidpkcs11.so&lt;br /&gt;
&lt;br /&gt;
You can see your certificate in Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; View Certificates and you can trust the Belgium Root CA under the &amp;quot;Authorities&amp;quot; tab for e.g. &amp;quot;identifying mail users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Try to sign a first mail:&lt;br /&gt;
&amp;lt;br&amp;gt;Menu S-MIME -&amp;gt; Digitally sign this message -&amp;gt; setup certificate -&amp;gt; digital signing -&amp;gt; select your BELPIC auth certif&lt;br /&gt;
&lt;br /&gt;
I could successfully sign (with my PIN) and verify an email but only with the Authentication certificate, not the Signature certificate&lt;br /&gt;
&amp;lt;br&amp;gt;According to the snapshots of the official guide of the eID for Outlook, it&#039;s ok, the Authentication certificate must be used, the other being reserved for legal signatures.&lt;br /&gt;
&amp;lt;br&amp;gt;UPDATE: Well now that I saw that Wouter could sign with the signature certificate I tried again and indeed it works.&lt;br /&gt;
&lt;br /&gt;
One difficulty is that the certificate is not bound to an email address so the email client tells you sth like it&#039;s validly signed but no idea if the certificate owner corresponds to the sender email address.&lt;br /&gt;
&lt;br /&gt;
===Signing with pkcs15-crypt===&lt;br /&gt;
From https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/UsingOpenscTOC#using_opensc_smartcards_to_sign&lt;br /&gt;
&lt;br /&gt;
Signing text and extracting the public certificate:&lt;br /&gt;
 fortune &amp;gt; data.txt&lt;br /&gt;
 openssl sha1 -binary data.txt &amp;gt; data.sha1&lt;br /&gt;
 pkcs15-crypt --key 2 --sign --pkcs1 --sha-1 --input data.sha1 --output data.auth.sig&lt;br /&gt;
 pkcs15-tool --read-certificate 02 &amp;gt; my_auth.crt&lt;br /&gt;
&lt;br /&gt;
Verifying the signature:&lt;br /&gt;
 openssl x509 -in my_auth.crt -pubkey -noout &amp;gt; my_auth.pem&lt;br /&gt;
 openssl dgst -sha1 -verify my_auth.pem -signature data.auth.sig data.txt&lt;br /&gt;
&lt;br /&gt;
I tried to do the same with the signature certificate instead of the authentication certificate but I get an error:&lt;br /&gt;
 pkcs15-crypt --key 3 --sign --pkcs1 --sha-1 --input data.sha1 --output data.auth.sig&lt;br /&gt;
 [pkcs15-crypt] sec.c:67:sc_set_security_env: returning with: Not supported&lt;br /&gt;
 [pkcs15-crypt] pkcs15-sec.c:267:sc_pkcs15_compute_signature: sc_set_security_env() failed: Not supported&lt;br /&gt;
 Compute signature failed: Not supported&lt;br /&gt;
Indeed signing with the signature certificate and without a GUI showing a warning about the legal implication is forbidden.&lt;br /&gt;
&lt;br /&gt;
===Signing with GpgSM===&lt;br /&gt;
GpgSM is to X.509 what GnuPG is to OpenPGP, cf http://gnupg.org/aegypten/tech.en.html&lt;br /&gt;
&lt;br /&gt;
 apt-get install gpgsm dirmngr gnupg-agent pinentry-qt&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/gpg-agent.conf:&lt;br /&gt;
 no-grab&lt;br /&gt;
 default-cache-ttl 1800&lt;br /&gt;
 ignore-cache-for-signing&lt;br /&gt;
 allow-mark-trusted&lt;br /&gt;
&lt;br /&gt;
 ~/.bash_profile: (appending this stuff)&lt;br /&gt;
 # preparing gpg-agent:&lt;br /&gt;
 if test -f $HOME/.gpg-agent-info &amp;amp;&amp;amp; kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2&amp;gt;/dev/null; then&lt;br /&gt;
   GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info`&lt;br /&gt;
   export GPG_AGENT_INFO&lt;br /&gt;
 else&lt;br /&gt;
   eval `gpg-agent --daemon`&lt;br /&gt;
   echo $GPG_AGENT_INFO &amp;gt;$HOME/.gpg-agent-info&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/scdaemon.conf: (we disable internal CCID support as only libccid supports more or less my crappy reader)&lt;br /&gt;
 disable-ccid&lt;br /&gt;
 debug-level none&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/gpgsm.conf:&lt;br /&gt;
 debug-level none&lt;br /&gt;
&lt;br /&gt;
Acquiring the certificates:&lt;br /&gt;
 $ gpgsm --learn-card&lt;br /&gt;
Actually I had to run it several times, the first time only the Belgium CA was extracted, then the Citizen CA and finally the 2 personal certificates. And the behavior is not really reproductible so you&#039;ve to run it till you&#039;ve the 4 certificates:&lt;br /&gt;
 $ gpgsm --list-keys&lt;br /&gt;
 /home/phil/.gnupg/pubring.kbx&lt;br /&gt;
 -----------------------------&lt;br /&gt;
      Subject: /CN=Belgium Root CA/C=BE&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Citizen CA/C=BE/SerialNumber=200507&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Philippe Teuwen (Authentication)/C=BE/SerialNumber=...&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Philippe Teuwen (Signature)/C=BE/SerialNumber=...&lt;br /&gt;
To sign sth:&lt;br /&gt;
 $ gpgsm --sign mail.txt&lt;br /&gt;
Then I get prompted to trust Belgium CA and gpgsm fails &amp;quot;error creating signature: Certificat révoqué &amp;lt;GpgSM&amp;gt;&amp;quot;, normal.&lt;br /&gt;
&amp;lt;br&amp;gt;During trusting the Belgium CA, it created automatically a .gnupg/trustlist.txt with&lt;br /&gt;
 # CN=Belgium Root CA,C=BE&lt;br /&gt;
 DF:DF:AC:89:47:BD:F7:52:64:A9:23:3A:C1:0E:E3:D1:28:33:DA:CC S&lt;br /&gt;
&lt;br /&gt;
Ok let&#039;s try again without the CRLs check:&lt;br /&gt;
 $ gpgsm --disable-crl-checks --armor --sign --output mail.txt.smime mail.txt&lt;br /&gt;
 [...]&lt;br /&gt;
 gpgsm: signature created&lt;br /&gt;
I was prompted for my PIN during the process.&lt;br /&gt;
&lt;br /&gt;
And trying to verify, with CRLs:&lt;br /&gt;
 $ gpgsm --verify --output mail.txt mail.txt.smime&lt;br /&gt;
 gpgsm: Signature made 2008-02-06 21:42:40 using certificate ID 0x80211056&lt;br /&gt;
 gpgsm: note: non-critical certificate policy not allowed&lt;br /&gt;
 dirmngr[8994]: error opening `/home/phil/.gnupg/dirmngr_ldapservers.conf&#039;: Aucun fichier ou répertoire de ce type&lt;br /&gt;
 dirmngr[8994]: permanently loaded certificates: 0&lt;br /&gt;
 dirmngr[8994]:     runtime cached certificates: 0&lt;br /&gt;
 dirmngr[8994]: command ISVALID failed: Certificat révoqué&lt;br /&gt;
 gpgsm: certificate #100000000000E144CBC42E9BB2453EE4/2.5.4.5=#323030353037,CN=Citizen CA,C=BE&lt;br /&gt;
 gpgsm: certificate has been revoked&lt;br /&gt;
 gpgsm: invalid certification chain: Certificat révoqué&lt;br /&gt;
And without CRLs:&lt;br /&gt;
 $ gpgsm --disable-crl-checks --verify --output mail.txt mail.txt.smime          &lt;br /&gt;
 gpgsm: Signature made 2008-02-06 21:42:40 using certificate ID 0x80211056&lt;br /&gt;
 gpgsm: CRLs not checked due to --disable-crl-checks option&lt;br /&gt;
 gpgsm: Good signature from &amp;quot;/CN=Philippe Teuwen (Authentication)/C=BE/SerialNumber=...&lt;br /&gt;
&lt;br /&gt;
===e-Signing plugin for Firefox===&lt;br /&gt;
* pure curiosity...&lt;br /&gt;
* cf http://www.certipost.be/dpsolutions/en/e-signing-faq.html&lt;br /&gt;
* the plugin is signed so you&#039;ve to install the CA certificate of Certipost first and, cf above in my &amp;quot;funny facts&amp;quot;, for Firefox, you&#039;ve to download and... trust it.&amp;lt;br&amp;gt;The certificate is apparently no longer (broken link) and I could not find it in their search tool, the only thing I could find is [http://64.233.183.104/search?q=cache:vzHK3UKTuiMJ:www.certipost.be/en/certificates/PrimaryNormalisedCA/certificate_pem.cer+PrimaryNormalisedCA&amp;amp;hl=fr&amp;amp;ct=clnk&amp;amp;cd=3&amp;amp;gl=fr a copy of the pem version in Google cache(!)]&amp;lt;br&amp;gt;but that was good enough to be able to install the plugin.&lt;br /&gt;
* Moreover [https://connect.e-signing.be/app/en/create the form to sign] wants to directly execute some jar file but under an SSL connection signed by... the so-hard-to-get Certipost CA certificate, itself signed by GTE CyberTrust Global Root, an authority built-in in the browsers.&lt;br /&gt;
* You&#039;ve [https://www.certipost.be/webshop/ to pay] to be able to sign with your eID non-repudiation signature to have a valid &#039;&#039;Qualified Electronic Signature with long term value&#039;&#039;&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/images/stories/e-signing/right/technical_measures_en.pdf There are some explanations] of the additional services provided by CertiPost:&amp;lt;br&amp;gt;&#039;&#039;The applied XAdES-X-L is an XML signature format according to the recognized XAdES standard (ETSI TS 101 903 standard) that implements measures to satisfy the legal requirements for advanced electronic signatures as defined in the European Directive (EC 1999/93: European Community (EC) DIRECTIVE 1999/93/EC OF THE EUROPEAN PARLIAMENT AND COUNCIL ON A COMMUNITY FRAMEWORK FOR ELECTRONIC SIGNATURES) and for long term non-repudiation. Next to the electronic signature itself, the XAdES-X-Lfile contains the certificate that was used during the signature, the information to proof whether the certificate was valid when signing, and a time stamp to proof that all information used for signing existed and not altered since.&amp;lt;br&amp;gt;Moreover CertiPost keeps a copy of the signed information.&lt;br /&gt;
* Timestamps &amp;amp; storage look like additional features, not mandated by the law, so can I create a &#039;&#039;Qualified Electronic Signature with long term value&#039;&#039; out of the CertiPost context, so just a plain x509 signature?&lt;br /&gt;
&lt;br /&gt;
===SSH===&lt;br /&gt;
Inspired from http://simi.be/?page_id=9&lt;br /&gt;
&lt;br /&gt;
Getting the patch from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=355274 and porting it to v4.7p1&lt;br /&gt;
&amp;lt;br&amp;gt;Some rejs easy to solve from v4.2 to v4.7 and one less obvious change in debian/control: fix the debconf dependancies (was ${debconf:Depends} I think):&lt;br /&gt;
 Package: openssh-client-sc                                                          &lt;br /&gt;
 Architecture: any                                                                   &lt;br /&gt;
 Depends: ${shlibs:Depends}, debconf (&amp;gt;= 1.2.0) | debconf-2.0,...&lt;br /&gt;
&amp;lt;br&amp;gt;I recompile ssh with smartcard support.&lt;br /&gt;
 apt-get source openssh-client&lt;br /&gt;
 cd openssh-4.7p1&lt;br /&gt;
 patch -p1 &amp;lt; ../mypatch&lt;br /&gt;
 dpkg-buildpackage -uc -us -rfakeroot&lt;br /&gt;
Sending my public key to the ssh server:&lt;br /&gt;
 pkcs15-tool --read-ssh-key 2 |tail -n1|ssh user@host &#039;cat - &amp;gt;&amp;gt; ~/.ssh/authorized_keys&#039;&lt;br /&gt;
Then logging, being prompted for my PIN:&lt;br /&gt;
 ssh -I 0 user@host.com&lt;br /&gt;
===OpenID===&lt;br /&gt;
cf [[OpenID]] and [[OpenID-eID]] where I&#039;m hacking phpMyID to make my own&lt;br /&gt;
&lt;br /&gt;
===TODO: Login===&lt;br /&gt;
I tried https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/UsingOpenscTOC#logging_in_with_smartcards&lt;br /&gt;
but with the eID.&lt;br /&gt;
 apt-get install libpam-p11&lt;br /&gt;
See file:///usr/share/doc/libpam-p11/QuickStart.html&lt;br /&gt;
&amp;lt;br&amp;gt;Bad side: it conflicts with xlockmore :-(&lt;br /&gt;
&lt;br /&gt;
openssh way:&lt;br /&gt;
&amp;lt;br&amp;gt;Preparing the account with .ssh/authorized_keys, cf SSH auth on this page&lt;br /&gt;
&amp;lt;br&amp;gt;Edit /etc/pam.d/login and add before &amp;quot;@include common-auth&amp;quot; sth like:&lt;br /&gt;
 auth sufficient pam_p11_openssh.so /usr/lib/opensc-pkcs11.so&lt;br /&gt;
/var/log/auth.log tells: no certificates found&lt;br /&gt;
or&lt;br /&gt;
 auth sufficient pam_p11_openssh.so /usr/lib/libbeidpkcs11.so&lt;br /&gt;
/var/log/auth.log tells: fatal: pkcs11_sign failed &lt;br /&gt;
&amp;lt;br&amp;gt;before I was even prompted for my PIN&lt;br /&gt;
&lt;br /&gt;
opensc way: same results&lt;br /&gt;
 auth sufficient pam_p11_opensc.so /usr/lib/opensc-pkcs11.so&lt;br /&gt;
 auth sufficient pam_p11_opensc.so /usr/lib/libbeidpkcs11.so&lt;br /&gt;
preparing the account:&lt;br /&gt;
 mkdir ~/.eid&lt;br /&gt;
 chmod 0755 ~/.eid&lt;br /&gt;
 pkcs15-tool -r 2 &amp;gt; ~/.eid/authorized_certificates&lt;br /&gt;
 chmod 0644 ~/.eid/authorized_certificates&lt;br /&gt;
&lt;br /&gt;
So I still couldn&#039;t find a way.&lt;br /&gt;
&lt;br /&gt;
===TODO: SSL Auth===&lt;br /&gt;
http://blog.eikke.com/index.php/ikke/2007/10/29/using_your_belgian_eid_for_ssl_authentic&lt;br /&gt;
&lt;br /&gt;
 apt-get install libengine-pkcs11-openssl&lt;br /&gt;
&lt;br /&gt;
To generate a request, open a console and launch openssl. Once at the OpenSSL prompt, issue these 2 commands:&lt;br /&gt;
 engine -t dynamic -pre SO_PATH:/usr/lib/engines/engine_pkcs11.so -pre ID:pkcs11 -pre LIST_ADD:1 -pre LOAD -pre MODULE_PATH:/usr/lib/opensc-pkcs11.so&lt;br /&gt;
Adjust paths if necessary, of course. This loads the pkcs11 engine inside OpenSSL.&lt;br /&gt;
 req -engine pkcs11 -new -days 100 -key id_02 -keyform engine -out myrequest.csr -subj &amp;quot;/C=BE/ST=O-VL/O=My Organisation/CN=My Name/emailAddress=my@email.tld&amp;quot;&lt;br /&gt;
Adjust the days, out and subj parameters, at least. The key ID can be found using&lt;br /&gt;
 pkcs15-tool -c&lt;br /&gt;
Use the ID of the Authentication X509 certificate.&lt;br /&gt;
&lt;br /&gt;
===TODO: Apache SSL Reverse Proxy===&lt;br /&gt;
cf http://www.belgium.be/zip/eid_authentication_proxy_fr.html&lt;br /&gt;
===TODO: OpenGPG &amp;amp; x509===&lt;br /&gt;
Old dream is to sign an OpenPGP key with the eID, but even if technically possible, it probably breaks the validation chain as what Citizen CA signed was the entire certificate, not just the key/uid.&lt;br /&gt;
&amp;lt;br&amp;gt;Sth to check: [http://www.imc.org/ietf-openpgp/mail-archive/msg09930.html OpenPGP Signatures Incorporating X.509 Certificates]&lt;br /&gt;
&amp;lt;br&amp;gt;The solution is apparently to extend OpenGPG to allow special signatures on UIDs with sub-packets containing the entire certificate, the UID being build from the DN fields of the certificate (CN, EMAIL,...)&lt;br /&gt;
&amp;lt;br&amp;gt;Apparently PGP supports it already?&lt;br /&gt;
&lt;br /&gt;
===TODO: OpenVPN Auth===&lt;br /&gt;
http://christophe.vandeplas.com/2008/02/03/openvpn-belgian-eid&lt;br /&gt;
&amp;lt;br&amp;gt;But Debian openvpn 2.1_cr4 doesn&#039;t support yet --show-pkcs11-ids&lt;br /&gt;
===TODO: Other tools===&lt;br /&gt;
* [http://sourceforge.net/projects/opensignature OpenSignature] for Italia&lt;br /&gt;
* [http://openportalguard.sourceforge.net/ Open Portal Guard] for e.g. public administrations&lt;br /&gt;
* beidcrld: where are CRLs downloaded to?&lt;br /&gt;
* beidpcscd: how to test it?&lt;br /&gt;
* beidlib.jar: BEIDCard.html and Test.java&lt;br /&gt;
* Novell version in C#...&lt;br /&gt;
** I could compile but still runtime errors&lt;br /&gt;
** Support in OpenOffice? check the shell script&lt;/div&gt;</summary>
		<author><name>212.71.5.64</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=2944</id>
		<title>Belgian eID</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=2944"/>
		<updated>2008-03-05T07:45:44Z</updated>

		<summary type="html">&lt;p&gt;212.71.5.64: /* TODO: Other tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Belgian eID is part of the efforts of the government for [[Belgian eGov]]&lt;br /&gt;
==Officials==&lt;br /&gt;
&lt;br /&gt;
* [http://eid.belgium.be Official eID portal]&lt;br /&gt;
* [http://repository.eid.belgium.be/FR/Index.htm Certificates]&lt;br /&gt;
* [http://status.eid.belgium.be/ eID services]&lt;br /&gt;
* [http://crl.eid.belgium.be/ Revocation lists] and [http://ocsp.eid.belgium.be/ OCSP server]&lt;br /&gt;
* [http://eid.belgium.be/fr/navigation/documents/37129.html Circulaires (fr) eID Home  /  Villes et communes  /  Quoi  /  Circulaires]&amp;lt;br&amp;gt;Among others:&amp;lt;br&amp;gt; 3) FORMULAIRE DE RENONCIATION AUX CERTIFICATS DE LA CARTE D’IDENTITE ELECTRONIQUE AU MOMENT DE LA DEMANDE DE LA CARTE&amp;lt;br&amp;gt;10) MODELE D’ATTESTATION D’ACTIVATION OU DE REVOCATION DES CERTIFICATS APRES ACTIVATION DE LA CARTE&amp;lt;br&amp;gt;11) MODELE D’ATTESTATION DE SUSPENSION ET DE REACTIVATION DES CERTIFICATS&lt;br /&gt;
* [http://www.certipost.be CertiPost], by Belgacom &amp;amp; La Poste/De Post&lt;br /&gt;
** [http://www.certipost.be/x500/X500.html Certipost E-Trust™ Public X500 Directory Search]&lt;br /&gt;
&lt;br /&gt;
==Usage &amp;amp; Software==&lt;br /&gt;
&lt;br /&gt;
* [http://www.belgium.be/zip/eid_datacapture_fr.html Middleware &amp;amp; developer&#039;s kit]&lt;br /&gt;
** There are also Debian packages, cf below my tests under Linux&lt;br /&gt;
** [http://developer.novell.com/wiki/index.php/EID-belgium eID configuration toolkit by Novell]&lt;br /&gt;
* [http://homes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/WebHome Danny De Cock&#039;s page on eID] (same as http://www.godot.be)&lt;br /&gt;
* [http://weblogs.asp.net/cumpsd/archive/2005/04/03/396900.aspx short intro]&lt;br /&gt;
* [http://weblogs.asp.net/cumpsd/archive/2005/04/03/396901.aspx how to use the eID card within your .NET apps]&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
* http://www.foo.be/eID/ Official data, spec sheet etc (outdated)&lt;br /&gt;
* [http://belsec.skynetblogs.be/tag/1/E-ID Belsec blog entries] about the eID&lt;br /&gt;
* [http://www.uvcw.be/no_index/e-communes/dossier_eid/Belgian_eID_Run-time_Users_guide.pdf Belgian E-ID runtime guide windows/linux pdf]&lt;br /&gt;
* [http://www.porvoo8.rrn.fgov.be/porvoo8/doc13/09_porvoo8-bruegger18_Italy.pdf Open source interoperability and E-ID pdf]&lt;br /&gt;
* [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/5%20aspects%20techniques/fr/belpic_eid_version_numbering_v1.5.2.pdf The versioning of E-ID pdf]&lt;br /&gt;
* [http://porvoo10.net/p10/10_porvoo10-bud-25.pdf The road to European E-ID interoperability pdf]&lt;br /&gt;
* [http://www.microsoft.com/belux/nl/eid/ Microsoft and the eID], just an old marketing buzz? (I wouldn&#039;t complain...)&lt;br /&gt;
* [http://samba.grep.be/~wouter/beid-screencast.ogg], BeID screencast of what should have been shown at Fosdem 2008, by Wouter. (still waiting for the video of the presentation...)&lt;br /&gt;
* [http://www.lalibre.be/societe/cyber/article/404626/la-carte-d-identite-electronique-permettra-de-s-enregistrer-sur-ebay.html] La carte d&#039;identité électronique permettra de s&#039;enregistrer sur eBay&lt;br /&gt;
&lt;br /&gt;
==I revoked my certificates==&lt;br /&gt;
===Why?===&lt;br /&gt;
Because at that time I knew too few on the details of the eID architecture and too much about how a new security architecture can have flaws, so better to stay away for a while, especially given the legal implications that the eID can bring.&amp;lt;br&amp;gt;I knew they were talking about two certificates without understanding their difference, so let&#039;s revoke both.&amp;lt;br&amp;gt;Note that it doesn&#039;t mean my eID is not valid, eID card activation is mandatory. The eID card is a proof of identity and residence of a person in Belgium. eID certificates activation is a choice of the holder of the eID (opt-in), he/she can decide to activate or revoke the certificates. (cf [http://www.certipost.be/dpsolutions/en/eid-faq.html FAQ])&lt;br /&gt;
===How?===&lt;br /&gt;
It was quite epic.&lt;br /&gt;
&amp;lt;br&amp;gt;I was still a bit prepared, hopefully, so I had printed the Annexes 3 &amp;amp; 10, the legal forms to ask either to renounce to have the certificates or to revoke them just after activation, as well as the relevant parts of the User Manual for the civil servants :-)&lt;br /&gt;
&amp;lt;br&amp;gt;I printed both as for me it was not clear from the User Manual how to renounce for the certificates.&lt;br /&gt;
* [Me] Good morning, I come for my eID and... I want to get rid of the certificates&lt;br /&gt;
* [Her] You what? Is it possible? Never heard about that&lt;br /&gt;
* [Me] Yes, yes, see (and I show her what&#039;s in her User Manual)&lt;br /&gt;
* ... (takes a while to digest the info)&lt;br /&gt;
* [Her] Ha ok, you&#039;ve to fill Annex 3, (shouting behind her shoulder) JOSETTE, DO WE HAVE ANNEX 3???&lt;br /&gt;
* [Josette] ANNEX WHAT??&lt;br /&gt;
* [Me] No prob, look (and I pull out my own copy of [http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/03_-_FORMULAIRE_RENONCIATION_CERTIFS.pdf Annex 3 (pdf)])&lt;br /&gt;
* ... (meanwhile she has no idea what to do on the eID to fulfill renouncement and I agree with her, the Manual was unclear so we went for activation+revocation)&lt;br /&gt;
* [Me] No prob, look (and I pull out my own copy of [http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/10_-_Attestation_activ_Certificats(18-10)_27-07.pdf Annex 10 (pdf)])&lt;br /&gt;
* [Her] Can I take your copies before you fill them? I&#039;ll make copies for ourselves.&lt;br /&gt;
So today the official Annex 3&amp;amp;10 forms of this civil office are mine :-D&amp;lt;br&amp;gt;Who knows, maybe I crafted the form... ;-)&lt;br /&gt;
&lt;br /&gt;
It is &amp;quot;funny&amp;quot; to see that everywhere the activation of the certificates is presented as optional, the choice being left to the citizen, blablabla, but in reality most of the citizen just don&#039;t know about this possibility (and most of the civil servants, well I hope that since my story, things have evolved a bit) and the civil servants doesn&#039;t ask you the question.&lt;br /&gt;
&lt;br /&gt;
===Some details about those certificates===&lt;br /&gt;
The eID contains 2 signature certificates, so you cannot encrypt with them, just sign.&lt;br /&gt;
* One labeled &amp;quot;Authentication&amp;quot; is for daily use &lt;br /&gt;
** To log in on SSL websites such as [http://minfin.fgov.be/taxonweb/ Tax-on-web] or [http://www.saferchat.be SaferChat] or even your bank e.g. [http://www.keytradebank.com/pdf/eID_en.pdf Keytrade has implemented it (pdf)] with CRL check&lt;br /&gt;
** For signing mails with S/MIME&lt;br /&gt;
** For your own purpose, to log on your SSH server, SSL server, VPN etc&lt;br /&gt;
* One labeled &amp;quot;Signature&amp;quot; is for special cases&lt;br /&gt;
** It has a equivalent legal value as a hand-written signature and is referred as non-repudiation signature.&lt;br /&gt;
** According to [http://www.certipost.be/dpsolutions/images/stories/e-signing/right/applicability_en.pdf CertiPost applicability guidelines (pdf)], the electronic signature still cannot replace a hand-written signature in a number of cases&lt;br /&gt;
**It&#039;s automatically revoked for minors under 18 years as they cannot sign legally yet.&lt;br /&gt;
**From [http://www.certipost.be/dpsolutions/en/eid-faq.html Certipost FAQ]:&amp;lt;br&amp;gt;&#039;&#039;Non-repudiation guarantees that one cannot deny having performed an act. E.g. any message signed using a person&#039;s digital signature can only have come from this person. The signing person can not claim that the message was not originated by him.&amp;lt;br&amp;gt;In other words, non-repudiation means that information &#039;&#039;&#039;cannot be disclaimed&#039;&#039;&#039;, similar to a &#039;&#039;&#039;witnessed&#039;&#039;&#039; handwritten signature on a paper document.&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;to be checked in the law&#039;&#039;&lt;br /&gt;
** Normal pkcs software doesn&#039;t seem to be able to use it (?)&lt;br /&gt;
** Should be used only through the Government software which prompts you with a special GUI and warnings about the legal power of this signature&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/en/rem-overzicht.html CertiPost e-Registered mails] is using the non-repudiation signature&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/en/e-signing-overview.html CertiPost e-Signing] is using the non-repudiation signature&lt;br /&gt;
* Both are protected by the same PIN which is typed on your (unsafe) PC&lt;br /&gt;
&lt;br /&gt;
===What says the law===&lt;br /&gt;
Sorry, here are french version abstracts.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;9 JUILLET 2001. - Loi fixant certaines règles relatives au cadre juridique pour les signatures électroniques et les services de certification&#039;&#039;&#039;, date de publication au Moniteur: 29 septembre 2001&lt;br /&gt;
&amp;lt;br&amp;gt;Morceaux choisis:&lt;br /&gt;
* Art. 4. § 1er. A défaut de dispositions légales contraires, nul ne peut être contraint de poser un acte juridique par voie électronique.&lt;br /&gt;
* § 4. Sans préjudice des articles 1323 et suivants du Code civil, une signature électronique avancée réalisée sur la base d&#039;un certificat qualifié et conçue au moyen d&#039;un dispositif sécurisé de création de signature électronique, est assimilée à une signature manuscrite, qu&#039;elle soit réalisée par une personne physique ou morale.&lt;br /&gt;
* § 5. Une signature électronique ne peut être privée de son efficacité juridique et ne peut être refusée comme preuve en justice au seul motif :&lt;br /&gt;
** que la signature se présente sous forme électronique, ou&lt;br /&gt;
** qu&#039;elle ne repose pas sur un certificat qualifié, ou&lt;br /&gt;
** qu&#039;elle ne repose pas sur un certificat qualifié délivré par un prestataire accrédité de service de certification, ou&lt;br /&gt;
** qu&#039;elle n&#039;est pas créée par un dispositif sécurisé de création de signature.&lt;br /&gt;
* &#039;&#039;Wait a minute, ANY electronic signature NOT being based on a qualified certificate and NOT created in a secure environment CANNOT be refused as a legal proof???&amp;lt;br&amp;gt;Maybe it&#039;s me or the triple-negation sentences (lawyers, lawyers...) but it looks like § 5 goes much further than § 4&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===What do I think today?===&lt;br /&gt;
====Catastrophe scenario==== &lt;br /&gt;
* Someone captures your PIN while you&#039;re using it for &amp;quot;just authentication&amp;quot; via e.g. malware, virus, trojan, worm on the PC &lt;br /&gt;
** you know, the kind of stuff that never happens, anyway it&#039;s now [http://eid.belgium.be/fr/navigation/documents/39814.html your problem] even if the official middleware [http://blog.didierstevens.com/2007/12/31/how-can-i-trust-the-beid-runtime/ is not signed]&lt;br /&gt;
**And apparently even some readers with integrated keypads are [http://belsec.skynetblogs.be/post/5426553/belgian-eid-nr-11--keyloggers-work-with-eid not safer :-(]&lt;br /&gt;
**And apparently even commercial standalone smatcard terminals are [http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-711.pdf not safer :-( (pdf)]&lt;br /&gt;
**And, oh, I did a small test with [[Keyloggers|lkl, a userland keylogger]] and of course the PIN typed into the beid graphical prompt could be easily captured.&lt;br /&gt;
* He gets physical access to your eID, even briefly if he has e.g. a PDA with Internet &amp;amp; smartcard reader.&lt;br /&gt;
* Now he can sign with your legal signature anything you can imagine... and you cannot repudiate what he does.&lt;br /&gt;
* The fact that maybe legal signatures have to be crafted through CertiPost (cf e-signing below) doesn&#039;t change anything to this risk.&lt;br /&gt;
&lt;br /&gt;
====So what will I do next time?====&lt;br /&gt;
* I&#039;ll probably accept the Authentication certificate to be able to play around with it.&lt;br /&gt;
* For sure I&#039;ll revoke the Signature certificate unless they change their architecture.&lt;br /&gt;
** Not the same PIN than the other certificate.&lt;br /&gt;
** Better than 4 digits (&amp;amp; 3 attempts so 3 chances over 10000)&lt;br /&gt;
** Probably they limited themselves to one single small PIN in order to pass the [http://www.kafka.be Kafka test] ;-)&lt;br /&gt;
** Even then:&lt;br /&gt;
*** Then I could use it but only on trusted devices, that&#039;s another story...&lt;br /&gt;
*** You get the PIN &amp;amp; PUK by post if I remember well, this could be eavesdropped but you can change your PIN... So  as the PUK can unlock the PIN 12 times, the attacker has 36 chances over 10000, one over 278, mmm... And who said humans can generate random PINs? ;-)&lt;br /&gt;
&lt;br /&gt;
===Privacy and other security considerations===&lt;br /&gt;
* [http://idcorner.org/2005/07/04/the-belgian-eid-card-calamity/ Another] [http://www.idcorner.org/?p=121 consideration] I didn&#039;t talk about yet: PRIVACY&lt;br /&gt;
* Whoever sees your public certificate (which happens e.g. if you log to a SSL website with your card or &#039;&#039;&#039;if you simply send a signed email&#039;&#039;&#039;) sees your [http://www.ibz.rrn.fgov.be/ RRN (&amp;quot;rijksregistratienummer&amp;quot;)]&amp;lt;br&amp;gt;BTW here is [http://fr.wikipedia.org/wiki/Num%C3%A9ro_de_registre_national how it&#039;s constructed]: It is a total of 11 numbers of which the first 6 are your birthdate JJMMDD followed by three numbers to distinguish the people that were born on the same day (even for men, uneven for women) and the last two numbers are a control number. So if you know the birthdate and the sex of the person, and you know how the control sum is done (97-JJMMDDXXX%97), you only miss two and a half numbers coming from a linear incremental counter (001, 003,...) to recompile his national register number. For mine it takes less than 40 attempts it you proceed logically...&lt;br /&gt;
* [http://minfin.fgov.be/taxonweb/ Tax-on-web] announce it but what about the others and your mail correspondants?&amp;lt;br&amp;gt;&#039;&#039;Suite à l&#039;utilisation de votre moyen d&#039;authentification (carte d&#039;identité électronique ou token citoyen), le SPF Finances a connaissance de votre numéro de registre national.&amp;lt;br&amp;gt;Conformément à l&#039;arrêté royal du 25/04/1986 autorisant certaines autorités du Ministère des Finances à utiliser le numéro d&#039;identification du registre national des personnes physiques, votre numéro de registre national n&#039;est utilisé dans ce contexte qu&#039;à des fins d&#039;identification pour l&#039;accès aux applications du SPF Finances.&amp;lt;br&amp;gt;La loi du 8 décembre 1992 relative à la protection de la vie privée à l&#039;égard des traitements de données à caractère personnel s&#039;applique à ce traitement d&#039;identification dont le responsable est le SPF Finances, Boulevard Albert II, 33 à 1030 Bruxelles.&#039;&#039;&lt;br /&gt;
* Other &amp;quot;funny&amp;quot; facts: Belgium government doesn&#039;t bother about cross-certification with any common Root CA so when you want to visit an official site supposedly secured such as  https://ccff02.minfin.fgov.be/CCFF_Authentication/choseLoginMethod.do or https://mijndossier.rrn.fgov.be you&#039;re kindly asked to blindly trust the certificate, years after phishing was invented, sigh...&lt;br /&gt;
* And even &amp;quot;better&amp;quot;: for Firefox, [http://www.certipost.be/dpsolutions/en/e-signing-faq.html CertiPost e-Signing] requires you to download and install their CA certificate and to trust it for identifying everything: web sites, mail users and software! Here the download of the CA certificate is done... on pure http, sigh...&lt;br /&gt;
* [https://www.cosic.esat.kuleuven.be/adapid/ ADAPID project] is a consortium of researchers and industry representatives in Flanders decided to take action in an attempt to help avoid a national privacy calamity. After a first (non-public) report, the ADAPID project won the financial support of IWT-Flanders. ADAPID officially started July 1st, 2005 and will run until June 30th, 2009.&lt;br /&gt;
* Normally the third and definitive version of the eID should have been rolled out begin of this year (2008) but I&#039;ve no idea what are the changes.&lt;br /&gt;
* [http://www.cirb.irisnet.be/site/fr/eid/ethicalid/index_htm Ethical-ID] is a software which presents to the e.g. swimming pool employee the only relevant data e.g. the residence city.&lt;br /&gt;
&lt;br /&gt;
==My attempts under Linux==&lt;br /&gt;
I&#039;m using the [[IDream ID-SMID01 SmartCard reader]], bought for 10€&lt;br /&gt;
&lt;br /&gt;
Installing beidgui and dependencies:&lt;br /&gt;
 apt-get install beidgui beid-tools&lt;br /&gt;
 =&amp;gt; libopenct1 libpcsclite1 libbeidlibopensc2 libbeid2 beid-tools beidgui libccid pcscd &lt;br /&gt;
 less /usr/share/doc/libbeidlibopensc2/README.Debian&lt;br /&gt;
&lt;br /&gt;
The GUI application works well, including OCSP communication, showing me that my eID certificates are revoked, excellent!&lt;br /&gt;
&lt;br /&gt;
UPDATE: There is a version 2.6.0-3 available in unstable&lt;br /&gt;
 apt-get install -t unstable beidgui beid-tools&lt;br /&gt;
&lt;br /&gt;
There are 2 (optional) daemons provided with beid-tools:&lt;br /&gt;
* beidcrld&amp;lt;br&amp;gt;Automatic CRL download&lt;br /&gt;
* beidpcscd&amp;lt;br&amp;gt;The privacy filter monitors all commands sent to the card. When an application requests to read the identity data, address or photo from the eID card, the filter will display a message and ask the user&#039;s consent&amp;lt;br&amp;gt;it&#039;s listening on port tcp 2500 and beidcrld, firefox-bin and icedove-bin are constantly speaking with it...&lt;br /&gt;
&lt;br /&gt;
===Exploring===&lt;br /&gt;
 pkcs15-tool --dump&lt;br /&gt;
 pkcs15-tool --read-certificate 02 &amp;gt; my_auth.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 03 &amp;gt; my_sign.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 04 &amp;gt; belgium.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 06 &amp;gt;&amp;gt; belgium.crt&lt;br /&gt;
 openssl x509 -in my_auth.crt -text&lt;br /&gt;
 pkcs15-tool --read-ssh-key 2&lt;br /&gt;
 # For a little demo...&lt;br /&gt;
 beid-pkcs11-tool --slot 0 --login --test&lt;br /&gt;
There is also some java support but I couldn&#039;t try it yet.&lt;br /&gt;
&lt;br /&gt;
===Firefox security module===&lt;br /&gt;
To add the security module to Firefox:&lt;br /&gt;
 apt-get install libbeid2-dev libbeidlibopensc2-dev&lt;br /&gt;
Visit file:///usr/share/beid/beid-pkcs11-register.html to install the service&lt;br /&gt;
&lt;br /&gt;
Now what?...&lt;br /&gt;
&amp;lt;br&amp;gt;cf http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/eID-FR-Firefox.pdf&lt;br /&gt;
&amp;lt;br&amp;gt;You can see your certificate in Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; View Certificates and you can trust the Belgium Root CA under the &amp;quot;Authorities&amp;quot; tab for e.g. &amp;quot;identifying mail users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can then connect to federal sites like [http://minfin.fgov.be/taxonweb/ Tax-on-web] or the [https://mondossier.rrn.fgov.be RRN], being identified by your card &amp;amp; PIN.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that it works only if I start Firefox after having the eID in place in the reader.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that I didn&#039;t get much further, being redirected to e.g.&lt;br /&gt;
this nonexistent page but the title speaks for itself ;-) https://mondossier.rrn.fgov.be/CertificateRevoked.html&lt;br /&gt;
&lt;br /&gt;
===Thunderbird security module===&lt;br /&gt;
To add the security module to Firefox:&lt;br /&gt;
 apt-get install libbeid2-dev libbeidlibopensc2-dev&lt;br /&gt;
Menu preferences-&amp;gt;advanced-&amp;gt;certificates-&amp;gt;security devices-&amp;gt;load&lt;br /&gt;
 Module name: Belgium Identity Card PKCS#11&lt;br /&gt;
 Module filename: /usr/lib/libbeidpkcs11.so&lt;br /&gt;
&lt;br /&gt;
You can see your certificate in Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; View Certificates and you can trust the Belgium Root CA under the &amp;quot;Authorities&amp;quot; tab for e.g. &amp;quot;identifying mail users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Try to sign a first mail:&lt;br /&gt;
&amp;lt;br&amp;gt;Menu S-MIME -&amp;gt; Digitally sign this message -&amp;gt; setup certificate -&amp;gt; digital signing -&amp;gt; select your BELPIC auth certif&lt;br /&gt;
&lt;br /&gt;
I could successfully sign (with my PIN) and verify an email but only with the Authentication certificate, not the Signature certificate&lt;br /&gt;
&amp;lt;br&amp;gt;According to the snapshots of the official guide of the eID for Outlook, it&#039;s ok, the Authentication certificate must be used, the other being reserved for legal signatures.&lt;br /&gt;
&amp;lt;br&amp;gt;UPDATE: Well now that I saw that Wouter could sign with the signature certificate I tried again and indeed it works.&lt;br /&gt;
&lt;br /&gt;
One difficulty is that the certificate is not bound to an email address so the email client tells you sth like it&#039;s validly signed but no idea if the certificate owner corresponds to the sender email address.&lt;br /&gt;
&lt;br /&gt;
===Signing with pkcs15-crypt===&lt;br /&gt;
From https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/UsingOpenscTOC#using_opensc_smartcards_to_sign&lt;br /&gt;
&lt;br /&gt;
Signing text and extracting the public certificate:&lt;br /&gt;
 fortune &amp;gt; data.txt&lt;br /&gt;
 openssl sha1 -binary data.txt &amp;gt; data.sha1&lt;br /&gt;
 pkcs15-crypt --key 2 --sign --pkcs1 --sha-1 --input data.sha1 --output data.auth.sig&lt;br /&gt;
 pkcs15-tool --read-certificate 02 &amp;gt; my_auth.crt&lt;br /&gt;
&lt;br /&gt;
Verifying the signature:&lt;br /&gt;
 openssl x509 -in my_auth.crt -pubkey -noout &amp;gt; my_auth.pem&lt;br /&gt;
 openssl dgst -sha1 -verify my_auth.pem -signature data.auth.sig data.txt&lt;br /&gt;
&lt;br /&gt;
I tried to do the same with the signature certificate instead of the authentication certificate but I get an error:&lt;br /&gt;
 pkcs15-crypt --key 3 --sign --pkcs1 --sha-1 --input data.sha1 --output data.auth.sig&lt;br /&gt;
 [pkcs15-crypt] sec.c:67:sc_set_security_env: returning with: Not supported&lt;br /&gt;
 [pkcs15-crypt] pkcs15-sec.c:267:sc_pkcs15_compute_signature: sc_set_security_env() failed: Not supported&lt;br /&gt;
 Compute signature failed: Not supported&lt;br /&gt;
Indeed signing with the signature certificate and without a GUI showing a warning about the legal implication is forbidden.&lt;br /&gt;
&lt;br /&gt;
===Signing with GpgSM===&lt;br /&gt;
GpgSM is to X.509 what GnuPG is to OpenPGP, cf http://gnupg.org/aegypten/tech.en.html&lt;br /&gt;
&lt;br /&gt;
 apt-get install gpgsm dirmngr gnupg-agent pinentry-qt&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/gpg-agent.conf:&lt;br /&gt;
 no-grab&lt;br /&gt;
 default-cache-ttl 1800&lt;br /&gt;
 ignore-cache-for-signing&lt;br /&gt;
 allow-mark-trusted&lt;br /&gt;
&lt;br /&gt;
 ~/.bash_profile: (appending this stuff)&lt;br /&gt;
 # preparing gpg-agent:&lt;br /&gt;
 if test -f $HOME/.gpg-agent-info &amp;amp;&amp;amp; kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2&amp;gt;/dev/null; then&lt;br /&gt;
   GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info`&lt;br /&gt;
   export GPG_AGENT_INFO&lt;br /&gt;
 else&lt;br /&gt;
   eval `gpg-agent --daemon`&lt;br /&gt;
   echo $GPG_AGENT_INFO &amp;gt;$HOME/.gpg-agent-info&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/scdaemon.conf: (we disable internal CCID support as only libccid supports more or less my crappy reader)&lt;br /&gt;
 disable-ccid&lt;br /&gt;
 debug-level none&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/gpgsm.conf:&lt;br /&gt;
 debug-level none&lt;br /&gt;
&lt;br /&gt;
Acquiring the certificates:&lt;br /&gt;
 $ gpgsm --learn-card&lt;br /&gt;
Actually I had to run it several times, the first time only the Belgium CA was extracted, then the Citizen CA and finally the 2 personal certificates. And the behavior is not really reproductible so you&#039;ve to run it till you&#039;ve the 4 certificates:&lt;br /&gt;
 $ gpgsm --list-keys&lt;br /&gt;
 /home/phil/.gnupg/pubring.kbx&lt;br /&gt;
 -----------------------------&lt;br /&gt;
      Subject: /CN=Belgium Root CA/C=BE&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Citizen CA/C=BE/SerialNumber=200507&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Philippe Teuwen (Authentication)/C=BE/SerialNumber=...&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Philippe Teuwen (Signature)/C=BE/SerialNumber=...&lt;br /&gt;
To sign sth:&lt;br /&gt;
 $ gpgsm --sign mail.txt&lt;br /&gt;
Then I get prompted to trust Belgium CA and gpgsm fails &amp;quot;error creating signature: Certificat révoqué &amp;lt;GpgSM&amp;gt;&amp;quot;, normal.&lt;br /&gt;
&amp;lt;br&amp;gt;During trusting the Belgium CA, it created automatically a .gnupg/trustlist.txt with&lt;br /&gt;
 # CN=Belgium Root CA,C=BE&lt;br /&gt;
 DF:DF:AC:89:47:BD:F7:52:64:A9:23:3A:C1:0E:E3:D1:28:33:DA:CC S&lt;br /&gt;
&lt;br /&gt;
Ok let&#039;s try again without the CRLs check:&lt;br /&gt;
 $ gpgsm --disable-crl-checks --armor --sign --output mail.txt.smime mail.txt&lt;br /&gt;
 [...]&lt;br /&gt;
 gpgsm: signature created&lt;br /&gt;
I was prompted for my PIN during the process.&lt;br /&gt;
&lt;br /&gt;
And trying to verify, with CRLs:&lt;br /&gt;
 $ gpgsm --verify --output mail.txt mail.txt.smime&lt;br /&gt;
 gpgsm: Signature made 2008-02-06 21:42:40 using certificate ID 0x80211056&lt;br /&gt;
 gpgsm: note: non-critical certificate policy not allowed&lt;br /&gt;
 dirmngr[8994]: error opening `/home/phil/.gnupg/dirmngr_ldapservers.conf&#039;: Aucun fichier ou répertoire de ce type&lt;br /&gt;
 dirmngr[8994]: permanently loaded certificates: 0&lt;br /&gt;
 dirmngr[8994]:     runtime cached certificates: 0&lt;br /&gt;
 dirmngr[8994]: command ISVALID failed: Certificat révoqué&lt;br /&gt;
 gpgsm: certificate #100000000000E144CBC42E9BB2453EE4/2.5.4.5=#323030353037,CN=Citizen CA,C=BE&lt;br /&gt;
 gpgsm: certificate has been revoked&lt;br /&gt;
 gpgsm: invalid certification chain: Certificat révoqué&lt;br /&gt;
And without CRLs:&lt;br /&gt;
 $ gpgsm --disable-crl-checks --verify --output mail.txt mail.txt.smime          &lt;br /&gt;
 gpgsm: Signature made 2008-02-06 21:42:40 using certificate ID 0x80211056&lt;br /&gt;
 gpgsm: CRLs not checked due to --disable-crl-checks option&lt;br /&gt;
 gpgsm: Good signature from &amp;quot;/CN=Philippe Teuwen (Authentication)/C=BE/SerialNumber=...&lt;br /&gt;
&lt;br /&gt;
===e-Signing plugin for Firefox===&lt;br /&gt;
* pure curiosity...&lt;br /&gt;
* cf http://www.certipost.be/dpsolutions/en/e-signing-faq.html&lt;br /&gt;
* the plugin is signed so you&#039;ve to install the CA certificate of Certipost first and, cf above in my &amp;quot;funny facts&amp;quot;, for Firefox, you&#039;ve to download and... trust it.&amp;lt;br&amp;gt;The certificate is apparently no longer (broken link) and I could not find it in their search tool, the only thing I could find is [http://64.233.183.104/search?q=cache:vzHK3UKTuiMJ:www.certipost.be/en/certificates/PrimaryNormalisedCA/certificate_pem.cer+PrimaryNormalisedCA&amp;amp;hl=fr&amp;amp;ct=clnk&amp;amp;cd=3&amp;amp;gl=fr a copy of the pem version in Google cache(!)]&amp;lt;br&amp;gt;but that was good enough to be able to install the plugin.&lt;br /&gt;
* Moreover [https://connect.e-signing.be/app/en/create the form to sign] wants to directly execute some jar file but under an SSL connection signed by... the so-hard-to-get Certipost CA certificate, itself signed by GTE CyberTrust Global Root, an authority built-in in the browsers.&lt;br /&gt;
* You&#039;ve [https://www.certipost.be/webshop/ to pay] to be able to sign with your eID non-repudiation signature to have a valid &#039;&#039;Qualified Electronic Signature with long term value&#039;&#039;&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/images/stories/e-signing/right/technical_measures_en.pdf There are some explanations] of the additional services provided by CertiPost:&amp;lt;br&amp;gt;&#039;&#039;The applied XAdES-X-L is an XML signature format according to the recognized XAdES standard (ETSI TS 101 903 standard) that implements measures to satisfy the legal requirements for advanced electronic signatures as defined in the European Directive (EC 1999/93: European Community (EC) DIRECTIVE 1999/93/EC OF THE EUROPEAN PARLIAMENT AND COUNCIL ON A COMMUNITY FRAMEWORK FOR ELECTRONIC SIGNATURES) and for long term non-repudiation. Next to the electronic signature itself, the XAdES-X-Lfile contains the certificate that was used during the signature, the information to proof whether the certificate was valid when signing, and a time stamp to proof that all information used for signing existed and not altered since.&amp;lt;br&amp;gt;Moreover CertiPost keeps a copy of the signed information.&lt;br /&gt;
* Timestamps &amp;amp; storage look like additional features, not mandated by the law, so can I create a &#039;&#039;Qualified Electronic Signature with long term value&#039;&#039; out of the CertiPost context, so just a plain x509 signature?&lt;br /&gt;
&lt;br /&gt;
===SSH===&lt;br /&gt;
Inspired from http://simi.be/?page_id=9&lt;br /&gt;
&lt;br /&gt;
Getting the patch from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=355274 and porting it to v4.7p1&lt;br /&gt;
&amp;lt;br&amp;gt;Some rejs easy to solve from v4.2 to v4.7 and one less obvious change in debian/control: fix the debconf dependancies (was ${debconf:Depends} I think):&lt;br /&gt;
 Package: openssh-client-sc                                                          &lt;br /&gt;
 Architecture: any                                                                   &lt;br /&gt;
 Depends: ${shlibs:Depends}, debconf (&amp;gt;= 1.2.0) | debconf-2.0,...&lt;br /&gt;
&amp;lt;br&amp;gt;I recompile ssh with smartcard support.&lt;br /&gt;
 apt-get source openssh-client&lt;br /&gt;
 cd openssh-4.7p1&lt;br /&gt;
 patch -p1 &amp;lt; ../mypatch&lt;br /&gt;
 dpkg-buildpackage -uc -us -rfakeroot&lt;br /&gt;
Sending my public key to the ssh server:&lt;br /&gt;
 pkcs15-tool --read-ssh-key 2 |tail -n1|ssh user@host &#039;cat - &amp;gt;&amp;gt; ~/.ssh/authorized_keys&#039;&lt;br /&gt;
Then logging, being prompted for my PIN:&lt;br /&gt;
 ssh -I 0 user@host.com&lt;br /&gt;
===OpenID===&lt;br /&gt;
cf [[OpenID]] and [[OpenID-eID]] where I&#039;m hacking phpMyID to make my own&lt;br /&gt;
&lt;br /&gt;
===TODO: Login===&lt;br /&gt;
I tried https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/UsingOpenscTOC#logging_in_with_smartcards&lt;br /&gt;
but with the eID.&lt;br /&gt;
 apt-get install libpam-p11&lt;br /&gt;
See file:///usr/share/doc/libpam-p11/QuickStart.html&lt;br /&gt;
&amp;lt;br&amp;gt;Bad side: it conflicts with xlockmore :-(&lt;br /&gt;
&lt;br /&gt;
openssh way:&lt;br /&gt;
&amp;lt;br&amp;gt;Preparing the account with .ssh/authorized_keys, cf SSH auth on this page&lt;br /&gt;
&amp;lt;br&amp;gt;Edit /etc/pam.d/login and add before &amp;quot;@include common-auth&amp;quot; sth like:&lt;br /&gt;
 auth sufficient pam_p11_openssh.so /usr/lib/opensc-pkcs11.so&lt;br /&gt;
/var/log/auth.log tells: no certificates found&lt;br /&gt;
or&lt;br /&gt;
 auth sufficient pam_p11_openssh.so /usr/lib/libbeidpkcs11.so&lt;br /&gt;
/var/log/auth.log tells: fatal: pkcs11_sign failed &lt;br /&gt;
&amp;lt;br&amp;gt;before I was even prompted for my PIN&lt;br /&gt;
&lt;br /&gt;
opensc way: same results&lt;br /&gt;
 auth sufficient pam_p11_opensc.so /usr/lib/opensc-pkcs11.so&lt;br /&gt;
 auth sufficient pam_p11_opensc.so /usr/lib/libbeidpkcs11.so&lt;br /&gt;
preparing the account:&lt;br /&gt;
 mkdir ~/.eid&lt;br /&gt;
 chmod 0755 ~/.eid&lt;br /&gt;
 pkcs15-tool -r 2 &amp;gt; ~/.eid/authorized_certificates&lt;br /&gt;
 chmod 0644 ~/.eid/authorized_certificates&lt;br /&gt;
&lt;br /&gt;
So I still couldn&#039;t find a way.&lt;br /&gt;
&lt;br /&gt;
===TODO: SSL Auth===&lt;br /&gt;
http://blog.eikke.com/index.php/ikke/2007/10/29/using_your_belgian_eid_for_ssl_authentic&lt;br /&gt;
&lt;br /&gt;
 apt-get install libengine-pkcs11-openssl&lt;br /&gt;
&lt;br /&gt;
To generate a request, open a console and launch openssl. Once at the OpenSSL prompt, issue these 2 commands:&lt;br /&gt;
 engine -t dynamic -pre SO_PATH:/usr/lib/engines/engine_pkcs11.so -pre ID:pkcs11 -pre LIST_ADD:1 -pre LOAD -pre MODULE_PATH:/usr/lib/opensc-pkcs11.so&lt;br /&gt;
Adjust paths if necessary, of course. This loads the pkcs11 engine inside OpenSSL.&lt;br /&gt;
 req -engine pkcs11 -new -days 100 -key id_02 -keyform engine -out myrequest.csr -subj &amp;quot;/C=BE/ST=O-VL/O=My Organisation/CN=My Name/emailAddress=my@email.tld&amp;quot;&lt;br /&gt;
Adjust the days, out and subj parameters, at least. The key ID can be found using&lt;br /&gt;
 pkcs15-tool -c&lt;br /&gt;
Use the ID of the Authentication X509 certificate.&lt;br /&gt;
&lt;br /&gt;
===TODO: Apache SSL Reverse Proxy===&lt;br /&gt;
cf http://www.belgium.be/zip/eid_authentication_proxy_fr.html&lt;br /&gt;
===TODO: OpenGPG &amp;amp; x509===&lt;br /&gt;
Old dream is to sign an OpenPGP key with the eID, but even if technically possible, it probably breaks the validation chain as what Citizen CA signed was the entire certificate, not just the key/uid.&lt;br /&gt;
&amp;lt;br&amp;gt;Sth to check: [http://www.imc.org/ietf-openpgp/mail-archive/msg09930.html OpenPGP Signatures Incorporating X.509 Certificates]&lt;br /&gt;
&amp;lt;br&amp;gt;The solution is apparently to extend OpenGPG to allow special signatures on UIDs with sub-packets containing the entire certificate, the UID being build from the DN fields of the certificate (CN, EMAIL,...)&lt;br /&gt;
&amp;lt;br&amp;gt;Apparently PGP supports it already?&lt;br /&gt;
&lt;br /&gt;
===TODO: OpenVPN Auth===&lt;br /&gt;
http://christophe.vandeplas.com/2008/02/03/openvpn-belgian-eid&lt;br /&gt;
&amp;lt;br&amp;gt;But Debian openvpn 2.1_cr4 doesn&#039;t support yet --show-pkcs11-ids&lt;br /&gt;
===TODO: Other tools===&lt;br /&gt;
* [http://sourceforge.net/projects/opensignature OpenSignature] for Italia&lt;br /&gt;
* [http://openportalguard.sourceforge.net/ Open Portal Guard] for e.g. public administrations&lt;br /&gt;
* beidcrld: where are CRLs downloaded to?&lt;br /&gt;
* beidpcscd: how to test it?&lt;br /&gt;
* beidlib.jar &amp;amp; java applet...&lt;br /&gt;
* Novell version in C#...&lt;br /&gt;
** I could compile but still runtime errors&lt;br /&gt;
** Support in OpenOffice? check the shell script&lt;/div&gt;</summary>
		<author><name>212.71.5.64</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=2943</id>
		<title>Belgian eID</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=2943"/>
		<updated>2008-03-05T07:44:24Z</updated>

		<summary type="html">&lt;p&gt;212.71.5.64: /* TODO: Other tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Belgian eID is part of the efforts of the government for [[Belgian eGov]]&lt;br /&gt;
==Officials==&lt;br /&gt;
&lt;br /&gt;
* [http://eid.belgium.be Official eID portal]&lt;br /&gt;
* [http://repository.eid.belgium.be/FR/Index.htm Certificates]&lt;br /&gt;
* [http://status.eid.belgium.be/ eID services]&lt;br /&gt;
* [http://crl.eid.belgium.be/ Revocation lists] and [http://ocsp.eid.belgium.be/ OCSP server]&lt;br /&gt;
* [http://eid.belgium.be/fr/navigation/documents/37129.html Circulaires (fr) eID Home  /  Villes et communes  /  Quoi  /  Circulaires]&amp;lt;br&amp;gt;Among others:&amp;lt;br&amp;gt; 3) FORMULAIRE DE RENONCIATION AUX CERTIFICATS DE LA CARTE D’IDENTITE ELECTRONIQUE AU MOMENT DE LA DEMANDE DE LA CARTE&amp;lt;br&amp;gt;10) MODELE D’ATTESTATION D’ACTIVATION OU DE REVOCATION DES CERTIFICATS APRES ACTIVATION DE LA CARTE&amp;lt;br&amp;gt;11) MODELE D’ATTESTATION DE SUSPENSION ET DE REACTIVATION DES CERTIFICATS&lt;br /&gt;
* [http://www.certipost.be CertiPost], by Belgacom &amp;amp; La Poste/De Post&lt;br /&gt;
** [http://www.certipost.be/x500/X500.html Certipost E-Trust™ Public X500 Directory Search]&lt;br /&gt;
&lt;br /&gt;
==Usage &amp;amp; Software==&lt;br /&gt;
&lt;br /&gt;
* [http://www.belgium.be/zip/eid_datacapture_fr.html Middleware &amp;amp; developer&#039;s kit]&lt;br /&gt;
** There are also Debian packages, cf below my tests under Linux&lt;br /&gt;
** [http://developer.novell.com/wiki/index.php/EID-belgium eID configuration toolkit by Novell]&lt;br /&gt;
* [http://homes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/WebHome Danny De Cock&#039;s page on eID] (same as http://www.godot.be)&lt;br /&gt;
* [http://weblogs.asp.net/cumpsd/archive/2005/04/03/396900.aspx short intro]&lt;br /&gt;
* [http://weblogs.asp.net/cumpsd/archive/2005/04/03/396901.aspx how to use the eID card within your .NET apps]&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
* http://www.foo.be/eID/ Official data, spec sheet etc (outdated)&lt;br /&gt;
* [http://belsec.skynetblogs.be/tag/1/E-ID Belsec blog entries] about the eID&lt;br /&gt;
* [http://www.uvcw.be/no_index/e-communes/dossier_eid/Belgian_eID_Run-time_Users_guide.pdf Belgian E-ID runtime guide windows/linux pdf]&lt;br /&gt;
* [http://www.porvoo8.rrn.fgov.be/porvoo8/doc13/09_porvoo8-bruegger18_Italy.pdf Open source interoperability and E-ID pdf]&lt;br /&gt;
* [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/5%20aspects%20techniques/fr/belpic_eid_version_numbering_v1.5.2.pdf The versioning of E-ID pdf]&lt;br /&gt;
* [http://porvoo10.net/p10/10_porvoo10-bud-25.pdf The road to European E-ID interoperability pdf]&lt;br /&gt;
* [http://www.microsoft.com/belux/nl/eid/ Microsoft and the eID], just an old marketing buzz? (I wouldn&#039;t complain...)&lt;br /&gt;
* [http://samba.grep.be/~wouter/beid-screencast.ogg], BeID screencast of what should have been shown at Fosdem 2008, by Wouter. (still waiting for the video of the presentation...)&lt;br /&gt;
* [http://www.lalibre.be/societe/cyber/article/404626/la-carte-d-identite-electronique-permettra-de-s-enregistrer-sur-ebay.html] La carte d&#039;identité électronique permettra de s&#039;enregistrer sur eBay&lt;br /&gt;
&lt;br /&gt;
==I revoked my certificates==&lt;br /&gt;
===Why?===&lt;br /&gt;
Because at that time I knew too few on the details of the eID architecture and too much about how a new security architecture can have flaws, so better to stay away for a while, especially given the legal implications that the eID can bring.&amp;lt;br&amp;gt;I knew they were talking about two certificates without understanding their difference, so let&#039;s revoke both.&amp;lt;br&amp;gt;Note that it doesn&#039;t mean my eID is not valid, eID card activation is mandatory. The eID card is a proof of identity and residence of a person in Belgium. eID certificates activation is a choice of the holder of the eID (opt-in), he/she can decide to activate or revoke the certificates. (cf [http://www.certipost.be/dpsolutions/en/eid-faq.html FAQ])&lt;br /&gt;
===How?===&lt;br /&gt;
It was quite epic.&lt;br /&gt;
&amp;lt;br&amp;gt;I was still a bit prepared, hopefully, so I had printed the Annexes 3 &amp;amp; 10, the legal forms to ask either to renounce to have the certificates or to revoke them just after activation, as well as the relevant parts of the User Manual for the civil servants :-)&lt;br /&gt;
&amp;lt;br&amp;gt;I printed both as for me it was not clear from the User Manual how to renounce for the certificates.&lt;br /&gt;
* [Me] Good morning, I come for my eID and... I want to get rid of the certificates&lt;br /&gt;
* [Her] You what? Is it possible? Never heard about that&lt;br /&gt;
* [Me] Yes, yes, see (and I show her what&#039;s in her User Manual)&lt;br /&gt;
* ... (takes a while to digest the info)&lt;br /&gt;
* [Her] Ha ok, you&#039;ve to fill Annex 3, (shouting behind her shoulder) JOSETTE, DO WE HAVE ANNEX 3???&lt;br /&gt;
* [Josette] ANNEX WHAT??&lt;br /&gt;
* [Me] No prob, look (and I pull out my own copy of [http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/03_-_FORMULAIRE_RENONCIATION_CERTIFS.pdf Annex 3 (pdf)])&lt;br /&gt;
* ... (meanwhile she has no idea what to do on the eID to fulfill renouncement and I agree with her, the Manual was unclear so we went for activation+revocation)&lt;br /&gt;
* [Me] No prob, look (and I pull out my own copy of [http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/10_-_Attestation_activ_Certificats(18-10)_27-07.pdf Annex 10 (pdf)])&lt;br /&gt;
* [Her] Can I take your copies before you fill them? I&#039;ll make copies for ourselves.&lt;br /&gt;
So today the official Annex 3&amp;amp;10 forms of this civil office are mine :-D&amp;lt;br&amp;gt;Who knows, maybe I crafted the form... ;-)&lt;br /&gt;
&lt;br /&gt;
It is &amp;quot;funny&amp;quot; to see that everywhere the activation of the certificates is presented as optional, the choice being left to the citizen, blablabla, but in reality most of the citizen just don&#039;t know about this possibility (and most of the civil servants, well I hope that since my story, things have evolved a bit) and the civil servants doesn&#039;t ask you the question.&lt;br /&gt;
&lt;br /&gt;
===Some details about those certificates===&lt;br /&gt;
The eID contains 2 signature certificates, so you cannot encrypt with them, just sign.&lt;br /&gt;
* One labeled &amp;quot;Authentication&amp;quot; is for daily use &lt;br /&gt;
** To log in on SSL websites such as [http://minfin.fgov.be/taxonweb/ Tax-on-web] or [http://www.saferchat.be SaferChat] or even your bank e.g. [http://www.keytradebank.com/pdf/eID_en.pdf Keytrade has implemented it (pdf)] with CRL check&lt;br /&gt;
** For signing mails with S/MIME&lt;br /&gt;
** For your own purpose, to log on your SSH server, SSL server, VPN etc&lt;br /&gt;
* One labeled &amp;quot;Signature&amp;quot; is for special cases&lt;br /&gt;
** It has a equivalent legal value as a hand-written signature and is referred as non-repudiation signature.&lt;br /&gt;
** According to [http://www.certipost.be/dpsolutions/images/stories/e-signing/right/applicability_en.pdf CertiPost applicability guidelines (pdf)], the electronic signature still cannot replace a hand-written signature in a number of cases&lt;br /&gt;
**It&#039;s automatically revoked for minors under 18 years as they cannot sign legally yet.&lt;br /&gt;
**From [http://www.certipost.be/dpsolutions/en/eid-faq.html Certipost FAQ]:&amp;lt;br&amp;gt;&#039;&#039;Non-repudiation guarantees that one cannot deny having performed an act. E.g. any message signed using a person&#039;s digital signature can only have come from this person. The signing person can not claim that the message was not originated by him.&amp;lt;br&amp;gt;In other words, non-repudiation means that information &#039;&#039;&#039;cannot be disclaimed&#039;&#039;&#039;, similar to a &#039;&#039;&#039;witnessed&#039;&#039;&#039; handwritten signature on a paper document.&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;to be checked in the law&#039;&#039;&lt;br /&gt;
** Normal pkcs software doesn&#039;t seem to be able to use it (?)&lt;br /&gt;
** Should be used only through the Government software which prompts you with a special GUI and warnings about the legal power of this signature&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/en/rem-overzicht.html CertiPost e-Registered mails] is using the non-repudiation signature&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/en/e-signing-overview.html CertiPost e-Signing] is using the non-repudiation signature&lt;br /&gt;
* Both are protected by the same PIN which is typed on your (unsafe) PC&lt;br /&gt;
&lt;br /&gt;
===What says the law===&lt;br /&gt;
Sorry, here are french version abstracts.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;9 JUILLET 2001. - Loi fixant certaines règles relatives au cadre juridique pour les signatures électroniques et les services de certification&#039;&#039;&#039;, date de publication au Moniteur: 29 septembre 2001&lt;br /&gt;
&amp;lt;br&amp;gt;Morceaux choisis:&lt;br /&gt;
* Art. 4. § 1er. A défaut de dispositions légales contraires, nul ne peut être contraint de poser un acte juridique par voie électronique.&lt;br /&gt;
* § 4. Sans préjudice des articles 1323 et suivants du Code civil, une signature électronique avancée réalisée sur la base d&#039;un certificat qualifié et conçue au moyen d&#039;un dispositif sécurisé de création de signature électronique, est assimilée à une signature manuscrite, qu&#039;elle soit réalisée par une personne physique ou morale.&lt;br /&gt;
* § 5. Une signature électronique ne peut être privée de son efficacité juridique et ne peut être refusée comme preuve en justice au seul motif :&lt;br /&gt;
** que la signature se présente sous forme électronique, ou&lt;br /&gt;
** qu&#039;elle ne repose pas sur un certificat qualifié, ou&lt;br /&gt;
** qu&#039;elle ne repose pas sur un certificat qualifié délivré par un prestataire accrédité de service de certification, ou&lt;br /&gt;
** qu&#039;elle n&#039;est pas créée par un dispositif sécurisé de création de signature.&lt;br /&gt;
* &#039;&#039;Wait a minute, ANY electronic signature NOT being based on a qualified certificate and NOT created in a secure environment CANNOT be refused as a legal proof???&amp;lt;br&amp;gt;Maybe it&#039;s me or the triple-negation sentences (lawyers, lawyers...) but it looks like § 5 goes much further than § 4&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===What do I think today?===&lt;br /&gt;
====Catastrophe scenario==== &lt;br /&gt;
* Someone captures your PIN while you&#039;re using it for &amp;quot;just authentication&amp;quot; via e.g. malware, virus, trojan, worm on the PC &lt;br /&gt;
** you know, the kind of stuff that never happens, anyway it&#039;s now [http://eid.belgium.be/fr/navigation/documents/39814.html your problem] even if the official middleware [http://blog.didierstevens.com/2007/12/31/how-can-i-trust-the-beid-runtime/ is not signed]&lt;br /&gt;
**And apparently even some readers with integrated keypads are [http://belsec.skynetblogs.be/post/5426553/belgian-eid-nr-11--keyloggers-work-with-eid not safer :-(]&lt;br /&gt;
**And apparently even commercial standalone smatcard terminals are [http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-711.pdf not safer :-( (pdf)]&lt;br /&gt;
**And, oh, I did a small test with [[Keyloggers|lkl, a userland keylogger]] and of course the PIN typed into the beid graphical prompt could be easily captured.&lt;br /&gt;
* He gets physical access to your eID, even briefly if he has e.g. a PDA with Internet &amp;amp; smartcard reader.&lt;br /&gt;
* Now he can sign with your legal signature anything you can imagine... and you cannot repudiate what he does.&lt;br /&gt;
* The fact that maybe legal signatures have to be crafted through CertiPost (cf e-signing below) doesn&#039;t change anything to this risk.&lt;br /&gt;
&lt;br /&gt;
====So what will I do next time?====&lt;br /&gt;
* I&#039;ll probably accept the Authentication certificate to be able to play around with it.&lt;br /&gt;
* For sure I&#039;ll revoke the Signature certificate unless they change their architecture.&lt;br /&gt;
** Not the same PIN than the other certificate.&lt;br /&gt;
** Better than 4 digits (&amp;amp; 3 attempts so 3 chances over 10000)&lt;br /&gt;
** Probably they limited themselves to one single small PIN in order to pass the [http://www.kafka.be Kafka test] ;-)&lt;br /&gt;
** Even then:&lt;br /&gt;
*** Then I could use it but only on trusted devices, that&#039;s another story...&lt;br /&gt;
*** You get the PIN &amp;amp; PUK by post if I remember well, this could be eavesdropped but you can change your PIN... So  as the PUK can unlock the PIN 12 times, the attacker has 36 chances over 10000, one over 278, mmm... And who said humans can generate random PINs? ;-)&lt;br /&gt;
&lt;br /&gt;
===Privacy and other security considerations===&lt;br /&gt;
* [http://idcorner.org/2005/07/04/the-belgian-eid-card-calamity/ Another] [http://www.idcorner.org/?p=121 consideration] I didn&#039;t talk about yet: PRIVACY&lt;br /&gt;
* Whoever sees your public certificate (which happens e.g. if you log to a SSL website with your card or &#039;&#039;&#039;if you simply send a signed email&#039;&#039;&#039;) sees your [http://www.ibz.rrn.fgov.be/ RRN (&amp;quot;rijksregistratienummer&amp;quot;)]&amp;lt;br&amp;gt;BTW here is [http://fr.wikipedia.org/wiki/Num%C3%A9ro_de_registre_national how it&#039;s constructed]: It is a total of 11 numbers of which the first 6 are your birthdate JJMMDD followed by three numbers to distinguish the people that were born on the same day (even for men, uneven for women) and the last two numbers are a control number. So if you know the birthdate and the sex of the person, and you know how the control sum is done (97-JJMMDDXXX%97), you only miss two and a half numbers coming from a linear incremental counter (001, 003,...) to recompile his national register number. For mine it takes less than 40 attempts it you proceed logically...&lt;br /&gt;
* [http://minfin.fgov.be/taxonweb/ Tax-on-web] announce it but what about the others and your mail correspondants?&amp;lt;br&amp;gt;&#039;&#039;Suite à l&#039;utilisation de votre moyen d&#039;authentification (carte d&#039;identité électronique ou token citoyen), le SPF Finances a connaissance de votre numéro de registre national.&amp;lt;br&amp;gt;Conformément à l&#039;arrêté royal du 25/04/1986 autorisant certaines autorités du Ministère des Finances à utiliser le numéro d&#039;identification du registre national des personnes physiques, votre numéro de registre national n&#039;est utilisé dans ce contexte qu&#039;à des fins d&#039;identification pour l&#039;accès aux applications du SPF Finances.&amp;lt;br&amp;gt;La loi du 8 décembre 1992 relative à la protection de la vie privée à l&#039;égard des traitements de données à caractère personnel s&#039;applique à ce traitement d&#039;identification dont le responsable est le SPF Finances, Boulevard Albert II, 33 à 1030 Bruxelles.&#039;&#039;&lt;br /&gt;
* Other &amp;quot;funny&amp;quot; facts: Belgium government doesn&#039;t bother about cross-certification with any common Root CA so when you want to visit an official site supposedly secured such as  https://ccff02.minfin.fgov.be/CCFF_Authentication/choseLoginMethod.do or https://mijndossier.rrn.fgov.be you&#039;re kindly asked to blindly trust the certificate, years after phishing was invented, sigh...&lt;br /&gt;
* And even &amp;quot;better&amp;quot;: for Firefox, [http://www.certipost.be/dpsolutions/en/e-signing-faq.html CertiPost e-Signing] requires you to download and install their CA certificate and to trust it for identifying everything: web sites, mail users and software! Here the download of the CA certificate is done... on pure http, sigh...&lt;br /&gt;
* [https://www.cosic.esat.kuleuven.be/adapid/ ADAPID project] is a consortium of researchers and industry representatives in Flanders decided to take action in an attempt to help avoid a national privacy calamity. After a first (non-public) report, the ADAPID project won the financial support of IWT-Flanders. ADAPID officially started July 1st, 2005 and will run until June 30th, 2009.&lt;br /&gt;
* Normally the third and definitive version of the eID should have been rolled out begin of this year (2008) but I&#039;ve no idea what are the changes.&lt;br /&gt;
* [http://www.cirb.irisnet.be/site/fr/eid/ethicalid/index_htm Ethical-ID] is a software which presents to the e.g. swimming pool employee the only relevant data e.g. the residence city.&lt;br /&gt;
&lt;br /&gt;
==My attempts under Linux==&lt;br /&gt;
I&#039;m using the [[IDream ID-SMID01 SmartCard reader]], bought for 10€&lt;br /&gt;
&lt;br /&gt;
Installing beidgui and dependencies:&lt;br /&gt;
 apt-get install beidgui beid-tools&lt;br /&gt;
 =&amp;gt; libopenct1 libpcsclite1 libbeidlibopensc2 libbeid2 beid-tools beidgui libccid pcscd &lt;br /&gt;
 less /usr/share/doc/libbeidlibopensc2/README.Debian&lt;br /&gt;
&lt;br /&gt;
The GUI application works well, including OCSP communication, showing me that my eID certificates are revoked, excellent!&lt;br /&gt;
&lt;br /&gt;
UPDATE: There is a version 2.6.0-3 available in unstable&lt;br /&gt;
 apt-get install -t unstable beidgui beid-tools&lt;br /&gt;
&lt;br /&gt;
There are 2 (optional) daemons provided with beid-tools:&lt;br /&gt;
* beidcrld&amp;lt;br&amp;gt;Automatic CRL download&lt;br /&gt;
* beidpcscd&amp;lt;br&amp;gt;The privacy filter monitors all commands sent to the card. When an application requests to read the identity data, address or photo from the eID card, the filter will display a message and ask the user&#039;s consent&amp;lt;br&amp;gt;it&#039;s listening on port tcp 2500 and beidcrld, firefox-bin and icedove-bin are constantly speaking with it...&lt;br /&gt;
&lt;br /&gt;
===Exploring===&lt;br /&gt;
 pkcs15-tool --dump&lt;br /&gt;
 pkcs15-tool --read-certificate 02 &amp;gt; my_auth.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 03 &amp;gt; my_sign.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 04 &amp;gt; belgium.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 06 &amp;gt;&amp;gt; belgium.crt&lt;br /&gt;
 openssl x509 -in my_auth.crt -text&lt;br /&gt;
 pkcs15-tool --read-ssh-key 2&lt;br /&gt;
 # For a little demo...&lt;br /&gt;
 beid-pkcs11-tool --slot 0 --login --test&lt;br /&gt;
There is also some java support but I couldn&#039;t try it yet.&lt;br /&gt;
&lt;br /&gt;
===Firefox security module===&lt;br /&gt;
To add the security module to Firefox:&lt;br /&gt;
 apt-get install libbeid2-dev libbeidlibopensc2-dev&lt;br /&gt;
Visit file:///usr/share/beid/beid-pkcs11-register.html to install the service&lt;br /&gt;
&lt;br /&gt;
Now what?...&lt;br /&gt;
&amp;lt;br&amp;gt;cf http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/eID-FR-Firefox.pdf&lt;br /&gt;
&amp;lt;br&amp;gt;You can see your certificate in Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; View Certificates and you can trust the Belgium Root CA under the &amp;quot;Authorities&amp;quot; tab for e.g. &amp;quot;identifying mail users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can then connect to federal sites like [http://minfin.fgov.be/taxonweb/ Tax-on-web] or the [https://mondossier.rrn.fgov.be RRN], being identified by your card &amp;amp; PIN.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that it works only if I start Firefox after having the eID in place in the reader.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that I didn&#039;t get much further, being redirected to e.g.&lt;br /&gt;
this nonexistent page but the title speaks for itself ;-) https://mondossier.rrn.fgov.be/CertificateRevoked.html&lt;br /&gt;
&lt;br /&gt;
===Thunderbird security module===&lt;br /&gt;
To add the security module to Firefox:&lt;br /&gt;
 apt-get install libbeid2-dev libbeidlibopensc2-dev&lt;br /&gt;
Menu preferences-&amp;gt;advanced-&amp;gt;certificates-&amp;gt;security devices-&amp;gt;load&lt;br /&gt;
 Module name: Belgium Identity Card PKCS#11&lt;br /&gt;
 Module filename: /usr/lib/libbeidpkcs11.so&lt;br /&gt;
&lt;br /&gt;
You can see your certificate in Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; View Certificates and you can trust the Belgium Root CA under the &amp;quot;Authorities&amp;quot; tab for e.g. &amp;quot;identifying mail users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Try to sign a first mail:&lt;br /&gt;
&amp;lt;br&amp;gt;Menu S-MIME -&amp;gt; Digitally sign this message -&amp;gt; setup certificate -&amp;gt; digital signing -&amp;gt; select your BELPIC auth certif&lt;br /&gt;
&lt;br /&gt;
I could successfully sign (with my PIN) and verify an email but only with the Authentication certificate, not the Signature certificate&lt;br /&gt;
&amp;lt;br&amp;gt;According to the snapshots of the official guide of the eID for Outlook, it&#039;s ok, the Authentication certificate must be used, the other being reserved for legal signatures.&lt;br /&gt;
&amp;lt;br&amp;gt;UPDATE: Well now that I saw that Wouter could sign with the signature certificate I tried again and indeed it works.&lt;br /&gt;
&lt;br /&gt;
One difficulty is that the certificate is not bound to an email address so the email client tells you sth like it&#039;s validly signed but no idea if the certificate owner corresponds to the sender email address.&lt;br /&gt;
&lt;br /&gt;
===Signing with pkcs15-crypt===&lt;br /&gt;
From https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/UsingOpenscTOC#using_opensc_smartcards_to_sign&lt;br /&gt;
&lt;br /&gt;
Signing text and extracting the public certificate:&lt;br /&gt;
 fortune &amp;gt; data.txt&lt;br /&gt;
 openssl sha1 -binary data.txt &amp;gt; data.sha1&lt;br /&gt;
 pkcs15-crypt --key 2 --sign --pkcs1 --sha-1 --input data.sha1 --output data.auth.sig&lt;br /&gt;
 pkcs15-tool --read-certificate 02 &amp;gt; my_auth.crt&lt;br /&gt;
&lt;br /&gt;
Verifying the signature:&lt;br /&gt;
 openssl x509 -in my_auth.crt -pubkey -noout &amp;gt; my_auth.pem&lt;br /&gt;
 openssl dgst -sha1 -verify my_auth.pem -signature data.auth.sig data.txt&lt;br /&gt;
&lt;br /&gt;
I tried to do the same with the signature certificate instead of the authentication certificate but I get an error:&lt;br /&gt;
 pkcs15-crypt --key 3 --sign --pkcs1 --sha-1 --input data.sha1 --output data.auth.sig&lt;br /&gt;
 [pkcs15-crypt] sec.c:67:sc_set_security_env: returning with: Not supported&lt;br /&gt;
 [pkcs15-crypt] pkcs15-sec.c:267:sc_pkcs15_compute_signature: sc_set_security_env() failed: Not supported&lt;br /&gt;
 Compute signature failed: Not supported&lt;br /&gt;
Indeed signing with the signature certificate and without a GUI showing a warning about the legal implication is forbidden.&lt;br /&gt;
&lt;br /&gt;
===Signing with GpgSM===&lt;br /&gt;
GpgSM is to X.509 what GnuPG is to OpenPGP, cf http://gnupg.org/aegypten/tech.en.html&lt;br /&gt;
&lt;br /&gt;
 apt-get install gpgsm dirmngr gnupg-agent pinentry-qt&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/gpg-agent.conf:&lt;br /&gt;
 no-grab&lt;br /&gt;
 default-cache-ttl 1800&lt;br /&gt;
 ignore-cache-for-signing&lt;br /&gt;
 allow-mark-trusted&lt;br /&gt;
&lt;br /&gt;
 ~/.bash_profile: (appending this stuff)&lt;br /&gt;
 # preparing gpg-agent:&lt;br /&gt;
 if test -f $HOME/.gpg-agent-info &amp;amp;&amp;amp; kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2&amp;gt;/dev/null; then&lt;br /&gt;
   GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info`&lt;br /&gt;
   export GPG_AGENT_INFO&lt;br /&gt;
 else&lt;br /&gt;
   eval `gpg-agent --daemon`&lt;br /&gt;
   echo $GPG_AGENT_INFO &amp;gt;$HOME/.gpg-agent-info&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/scdaemon.conf: (we disable internal CCID support as only libccid supports more or less my crappy reader)&lt;br /&gt;
 disable-ccid&lt;br /&gt;
 debug-level none&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/gpgsm.conf:&lt;br /&gt;
 debug-level none&lt;br /&gt;
&lt;br /&gt;
Acquiring the certificates:&lt;br /&gt;
 $ gpgsm --learn-card&lt;br /&gt;
Actually I had to run it several times, the first time only the Belgium CA was extracted, then the Citizen CA and finally the 2 personal certificates. And the behavior is not really reproductible so you&#039;ve to run it till you&#039;ve the 4 certificates:&lt;br /&gt;
 $ gpgsm --list-keys&lt;br /&gt;
 /home/phil/.gnupg/pubring.kbx&lt;br /&gt;
 -----------------------------&lt;br /&gt;
      Subject: /CN=Belgium Root CA/C=BE&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Citizen CA/C=BE/SerialNumber=200507&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Philippe Teuwen (Authentication)/C=BE/SerialNumber=...&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Philippe Teuwen (Signature)/C=BE/SerialNumber=...&lt;br /&gt;
To sign sth:&lt;br /&gt;
 $ gpgsm --sign mail.txt&lt;br /&gt;
Then I get prompted to trust Belgium CA and gpgsm fails &amp;quot;error creating signature: Certificat révoqué &amp;lt;GpgSM&amp;gt;&amp;quot;, normal.&lt;br /&gt;
&amp;lt;br&amp;gt;During trusting the Belgium CA, it created automatically a .gnupg/trustlist.txt with&lt;br /&gt;
 # CN=Belgium Root CA,C=BE&lt;br /&gt;
 DF:DF:AC:89:47:BD:F7:52:64:A9:23:3A:C1:0E:E3:D1:28:33:DA:CC S&lt;br /&gt;
&lt;br /&gt;
Ok let&#039;s try again without the CRLs check:&lt;br /&gt;
 $ gpgsm --disable-crl-checks --armor --sign --output mail.txt.smime mail.txt&lt;br /&gt;
 [...]&lt;br /&gt;
 gpgsm: signature created&lt;br /&gt;
I was prompted for my PIN during the process.&lt;br /&gt;
&lt;br /&gt;
And trying to verify, with CRLs:&lt;br /&gt;
 $ gpgsm --verify --output mail.txt mail.txt.smime&lt;br /&gt;
 gpgsm: Signature made 2008-02-06 21:42:40 using certificate ID 0x80211056&lt;br /&gt;
 gpgsm: note: non-critical certificate policy not allowed&lt;br /&gt;
 dirmngr[8994]: error opening `/home/phil/.gnupg/dirmngr_ldapservers.conf&#039;: Aucun fichier ou répertoire de ce type&lt;br /&gt;
 dirmngr[8994]: permanently loaded certificates: 0&lt;br /&gt;
 dirmngr[8994]:     runtime cached certificates: 0&lt;br /&gt;
 dirmngr[8994]: command ISVALID failed: Certificat révoqué&lt;br /&gt;
 gpgsm: certificate #100000000000E144CBC42E9BB2453EE4/2.5.4.5=#323030353037,CN=Citizen CA,C=BE&lt;br /&gt;
 gpgsm: certificate has been revoked&lt;br /&gt;
 gpgsm: invalid certification chain: Certificat révoqué&lt;br /&gt;
And without CRLs:&lt;br /&gt;
 $ gpgsm --disable-crl-checks --verify --output mail.txt mail.txt.smime          &lt;br /&gt;
 gpgsm: Signature made 2008-02-06 21:42:40 using certificate ID 0x80211056&lt;br /&gt;
 gpgsm: CRLs not checked due to --disable-crl-checks option&lt;br /&gt;
 gpgsm: Good signature from &amp;quot;/CN=Philippe Teuwen (Authentication)/C=BE/SerialNumber=...&lt;br /&gt;
&lt;br /&gt;
===e-Signing plugin for Firefox===&lt;br /&gt;
* pure curiosity...&lt;br /&gt;
* cf http://www.certipost.be/dpsolutions/en/e-signing-faq.html&lt;br /&gt;
* the plugin is signed so you&#039;ve to install the CA certificate of Certipost first and, cf above in my &amp;quot;funny facts&amp;quot;, for Firefox, you&#039;ve to download and... trust it.&amp;lt;br&amp;gt;The certificate is apparently no longer (broken link) and I could not find it in their search tool, the only thing I could find is [http://64.233.183.104/search?q=cache:vzHK3UKTuiMJ:www.certipost.be/en/certificates/PrimaryNormalisedCA/certificate_pem.cer+PrimaryNormalisedCA&amp;amp;hl=fr&amp;amp;ct=clnk&amp;amp;cd=3&amp;amp;gl=fr a copy of the pem version in Google cache(!)]&amp;lt;br&amp;gt;but that was good enough to be able to install the plugin.&lt;br /&gt;
* Moreover [https://connect.e-signing.be/app/en/create the form to sign] wants to directly execute some jar file but under an SSL connection signed by... the so-hard-to-get Certipost CA certificate, itself signed by GTE CyberTrust Global Root, an authority built-in in the browsers.&lt;br /&gt;
* You&#039;ve [https://www.certipost.be/webshop/ to pay] to be able to sign with your eID non-repudiation signature to have a valid &#039;&#039;Qualified Electronic Signature with long term value&#039;&#039;&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/images/stories/e-signing/right/technical_measures_en.pdf There are some explanations] of the additional services provided by CertiPost:&amp;lt;br&amp;gt;&#039;&#039;The applied XAdES-X-L is an XML signature format according to the recognized XAdES standard (ETSI TS 101 903 standard) that implements measures to satisfy the legal requirements for advanced electronic signatures as defined in the European Directive (EC 1999/93: European Community (EC) DIRECTIVE 1999/93/EC OF THE EUROPEAN PARLIAMENT AND COUNCIL ON A COMMUNITY FRAMEWORK FOR ELECTRONIC SIGNATURES) and for long term non-repudiation. Next to the electronic signature itself, the XAdES-X-Lfile contains the certificate that was used during the signature, the information to proof whether the certificate was valid when signing, and a time stamp to proof that all information used for signing existed and not altered since.&amp;lt;br&amp;gt;Moreover CertiPost keeps a copy of the signed information.&lt;br /&gt;
* Timestamps &amp;amp; storage look like additional features, not mandated by the law, so can I create a &#039;&#039;Qualified Electronic Signature with long term value&#039;&#039; out of the CertiPost context, so just a plain x509 signature?&lt;br /&gt;
&lt;br /&gt;
===SSH===&lt;br /&gt;
Inspired from http://simi.be/?page_id=9&lt;br /&gt;
&lt;br /&gt;
Getting the patch from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=355274 and porting it to v4.7p1&lt;br /&gt;
&amp;lt;br&amp;gt;Some rejs easy to solve from v4.2 to v4.7 and one less obvious change in debian/control: fix the debconf dependancies (was ${debconf:Depends} I think):&lt;br /&gt;
 Package: openssh-client-sc                                                          &lt;br /&gt;
 Architecture: any                                                                   &lt;br /&gt;
 Depends: ${shlibs:Depends}, debconf (&amp;gt;= 1.2.0) | debconf-2.0,...&lt;br /&gt;
&amp;lt;br&amp;gt;I recompile ssh with smartcard support.&lt;br /&gt;
 apt-get source openssh-client&lt;br /&gt;
 cd openssh-4.7p1&lt;br /&gt;
 patch -p1 &amp;lt; ../mypatch&lt;br /&gt;
 dpkg-buildpackage -uc -us -rfakeroot&lt;br /&gt;
Sending my public key to the ssh server:&lt;br /&gt;
 pkcs15-tool --read-ssh-key 2 |tail -n1|ssh user@host &#039;cat - &amp;gt;&amp;gt; ~/.ssh/authorized_keys&#039;&lt;br /&gt;
Then logging, being prompted for my PIN:&lt;br /&gt;
 ssh -I 0 user@host.com&lt;br /&gt;
===OpenID===&lt;br /&gt;
cf [[OpenID]] and [[OpenID-eID]] where I&#039;m hacking phpMyID to make my own&lt;br /&gt;
&lt;br /&gt;
===TODO: Login===&lt;br /&gt;
I tried https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/UsingOpenscTOC#logging_in_with_smartcards&lt;br /&gt;
but with the eID.&lt;br /&gt;
 apt-get install libpam-p11&lt;br /&gt;
See file:///usr/share/doc/libpam-p11/QuickStart.html&lt;br /&gt;
&amp;lt;br&amp;gt;Bad side: it conflicts with xlockmore :-(&lt;br /&gt;
&lt;br /&gt;
openssh way:&lt;br /&gt;
&amp;lt;br&amp;gt;Preparing the account with .ssh/authorized_keys, cf SSH auth on this page&lt;br /&gt;
&amp;lt;br&amp;gt;Edit /etc/pam.d/login and add before &amp;quot;@include common-auth&amp;quot; sth like:&lt;br /&gt;
 auth sufficient pam_p11_openssh.so /usr/lib/opensc-pkcs11.so&lt;br /&gt;
/var/log/auth.log tells: no certificates found&lt;br /&gt;
or&lt;br /&gt;
 auth sufficient pam_p11_openssh.so /usr/lib/libbeidpkcs11.so&lt;br /&gt;
/var/log/auth.log tells: fatal: pkcs11_sign failed &lt;br /&gt;
&amp;lt;br&amp;gt;before I was even prompted for my PIN&lt;br /&gt;
&lt;br /&gt;
opensc way: same results&lt;br /&gt;
 auth sufficient pam_p11_opensc.so /usr/lib/opensc-pkcs11.so&lt;br /&gt;
 auth sufficient pam_p11_opensc.so /usr/lib/libbeidpkcs11.so&lt;br /&gt;
preparing the account:&lt;br /&gt;
 mkdir ~/.eid&lt;br /&gt;
 chmod 0755 ~/.eid&lt;br /&gt;
 pkcs15-tool -r 2 &amp;gt; ~/.eid/authorized_certificates&lt;br /&gt;
 chmod 0644 ~/.eid/authorized_certificates&lt;br /&gt;
&lt;br /&gt;
So I still couldn&#039;t find a way.&lt;br /&gt;
&lt;br /&gt;
===TODO: SSL Auth===&lt;br /&gt;
http://blog.eikke.com/index.php/ikke/2007/10/29/using_your_belgian_eid_for_ssl_authentic&lt;br /&gt;
&lt;br /&gt;
 apt-get install libengine-pkcs11-openssl&lt;br /&gt;
&lt;br /&gt;
To generate a request, open a console and launch openssl. Once at the OpenSSL prompt, issue these 2 commands:&lt;br /&gt;
 engine -t dynamic -pre SO_PATH:/usr/lib/engines/engine_pkcs11.so -pre ID:pkcs11 -pre LIST_ADD:1 -pre LOAD -pre MODULE_PATH:/usr/lib/opensc-pkcs11.so&lt;br /&gt;
Adjust paths if necessary, of course. This loads the pkcs11 engine inside OpenSSL.&lt;br /&gt;
 req -engine pkcs11 -new -days 100 -key id_02 -keyform engine -out myrequest.csr -subj &amp;quot;/C=BE/ST=O-VL/O=My Organisation/CN=My Name/emailAddress=my@email.tld&amp;quot;&lt;br /&gt;
Adjust the days, out and subj parameters, at least. The key ID can be found using&lt;br /&gt;
 pkcs15-tool -c&lt;br /&gt;
Use the ID of the Authentication X509 certificate.&lt;br /&gt;
&lt;br /&gt;
===TODO: Apache SSL Reverse Proxy===&lt;br /&gt;
cf http://www.belgium.be/zip/eid_authentication_proxy_fr.html&lt;br /&gt;
===TODO: OpenGPG &amp;amp; x509===&lt;br /&gt;
Old dream is to sign an OpenPGP key with the eID, but even if technically possible, it probably breaks the validation chain as what Citizen CA signed was the entire certificate, not just the key/uid.&lt;br /&gt;
&amp;lt;br&amp;gt;Sth to check: [http://www.imc.org/ietf-openpgp/mail-archive/msg09930.html OpenPGP Signatures Incorporating X.509 Certificates]&lt;br /&gt;
&amp;lt;br&amp;gt;The solution is apparently to extend OpenGPG to allow special signatures on UIDs with sub-packets containing the entire certificate, the UID being build from the DN fields of the certificate (CN, EMAIL,...)&lt;br /&gt;
&amp;lt;br&amp;gt;Apparently PGP supports it already?&lt;br /&gt;
&lt;br /&gt;
===TODO: OpenVPN Auth===&lt;br /&gt;
http://christophe.vandeplas.com/2008/02/03/openvpn-belgian-eid&lt;br /&gt;
&amp;lt;br&amp;gt;But Debian openvpn 2.1_cr4 doesn&#039;t support yet --show-pkcs11-ids&lt;br /&gt;
===TODO: Other tools===&lt;br /&gt;
* [http://sourceforge.net/projects/opensignature OpenSignature] for Italia&lt;br /&gt;
* [http://openportalguard.sourceforge.net/ Open Portal Guard] for e.g. public administrations&lt;br /&gt;
* beidcrld: where are CRLs downloaded to?&lt;br /&gt;
* beidpcscd: how to test it?&lt;br /&gt;
* beidlib.jar &amp;amp; java applet...&lt;br /&gt;
* Novell version in C#...&lt;br /&gt;
** I could compile but still runtime errors&lt;/div&gt;</summary>
		<author><name>212.71.5.64</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=2942</id>
		<title>Belgian eID</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=2942"/>
		<updated>2008-03-05T07:42:56Z</updated>

		<summary type="html">&lt;p&gt;212.71.5.64: /* TODO: Other tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Belgian eID is part of the efforts of the government for [[Belgian eGov]]&lt;br /&gt;
==Officials==&lt;br /&gt;
&lt;br /&gt;
* [http://eid.belgium.be Official eID portal]&lt;br /&gt;
* [http://repository.eid.belgium.be/FR/Index.htm Certificates]&lt;br /&gt;
* [http://status.eid.belgium.be/ eID services]&lt;br /&gt;
* [http://crl.eid.belgium.be/ Revocation lists] and [http://ocsp.eid.belgium.be/ OCSP server]&lt;br /&gt;
* [http://eid.belgium.be/fr/navigation/documents/37129.html Circulaires (fr) eID Home  /  Villes et communes  /  Quoi  /  Circulaires]&amp;lt;br&amp;gt;Among others:&amp;lt;br&amp;gt; 3) FORMULAIRE DE RENONCIATION AUX CERTIFICATS DE LA CARTE D’IDENTITE ELECTRONIQUE AU MOMENT DE LA DEMANDE DE LA CARTE&amp;lt;br&amp;gt;10) MODELE D’ATTESTATION D’ACTIVATION OU DE REVOCATION DES CERTIFICATS APRES ACTIVATION DE LA CARTE&amp;lt;br&amp;gt;11) MODELE D’ATTESTATION DE SUSPENSION ET DE REACTIVATION DES CERTIFICATS&lt;br /&gt;
* [http://www.certipost.be CertiPost], by Belgacom &amp;amp; La Poste/De Post&lt;br /&gt;
** [http://www.certipost.be/x500/X500.html Certipost E-Trust™ Public X500 Directory Search]&lt;br /&gt;
&lt;br /&gt;
==Usage &amp;amp; Software==&lt;br /&gt;
&lt;br /&gt;
* [http://www.belgium.be/zip/eid_datacapture_fr.html Middleware &amp;amp; developer&#039;s kit]&lt;br /&gt;
** There are also Debian packages, cf below my tests under Linux&lt;br /&gt;
** [http://developer.novell.com/wiki/index.php/EID-belgium eID configuration toolkit by Novell]&lt;br /&gt;
* [http://homes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/WebHome Danny De Cock&#039;s page on eID] (same as http://www.godot.be)&lt;br /&gt;
* [http://weblogs.asp.net/cumpsd/archive/2005/04/03/396900.aspx short intro]&lt;br /&gt;
* [http://weblogs.asp.net/cumpsd/archive/2005/04/03/396901.aspx how to use the eID card within your .NET apps]&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
* http://www.foo.be/eID/ Official data, spec sheet etc (outdated)&lt;br /&gt;
* [http://belsec.skynetblogs.be/tag/1/E-ID Belsec blog entries] about the eID&lt;br /&gt;
* [http://www.uvcw.be/no_index/e-communes/dossier_eid/Belgian_eID_Run-time_Users_guide.pdf Belgian E-ID runtime guide windows/linux pdf]&lt;br /&gt;
* [http://www.porvoo8.rrn.fgov.be/porvoo8/doc13/09_porvoo8-bruegger18_Italy.pdf Open source interoperability and E-ID pdf]&lt;br /&gt;
* [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/5%20aspects%20techniques/fr/belpic_eid_version_numbering_v1.5.2.pdf The versioning of E-ID pdf]&lt;br /&gt;
* [http://porvoo10.net/p10/10_porvoo10-bud-25.pdf The road to European E-ID interoperability pdf]&lt;br /&gt;
* [http://www.microsoft.com/belux/nl/eid/ Microsoft and the eID], just an old marketing buzz? (I wouldn&#039;t complain...)&lt;br /&gt;
* [http://samba.grep.be/~wouter/beid-screencast.ogg], BeID screencast of what should have been shown at Fosdem 2008, by Wouter. (still waiting for the video of the presentation...)&lt;br /&gt;
* [http://www.lalibre.be/societe/cyber/article/404626/la-carte-d-identite-electronique-permettra-de-s-enregistrer-sur-ebay.html] La carte d&#039;identité électronique permettra de s&#039;enregistrer sur eBay&lt;br /&gt;
&lt;br /&gt;
==I revoked my certificates==&lt;br /&gt;
===Why?===&lt;br /&gt;
Because at that time I knew too few on the details of the eID architecture and too much about how a new security architecture can have flaws, so better to stay away for a while, especially given the legal implications that the eID can bring.&amp;lt;br&amp;gt;I knew they were talking about two certificates without understanding their difference, so let&#039;s revoke both.&amp;lt;br&amp;gt;Note that it doesn&#039;t mean my eID is not valid, eID card activation is mandatory. The eID card is a proof of identity and residence of a person in Belgium. eID certificates activation is a choice of the holder of the eID (opt-in), he/she can decide to activate or revoke the certificates. (cf [http://www.certipost.be/dpsolutions/en/eid-faq.html FAQ])&lt;br /&gt;
===How?===&lt;br /&gt;
It was quite epic.&lt;br /&gt;
&amp;lt;br&amp;gt;I was still a bit prepared, hopefully, so I had printed the Annexes 3 &amp;amp; 10, the legal forms to ask either to renounce to have the certificates or to revoke them just after activation, as well as the relevant parts of the User Manual for the civil servants :-)&lt;br /&gt;
&amp;lt;br&amp;gt;I printed both as for me it was not clear from the User Manual how to renounce for the certificates.&lt;br /&gt;
* [Me] Good morning, I come for my eID and... I want to get rid of the certificates&lt;br /&gt;
* [Her] You what? Is it possible? Never heard about that&lt;br /&gt;
* [Me] Yes, yes, see (and I show her what&#039;s in her User Manual)&lt;br /&gt;
* ... (takes a while to digest the info)&lt;br /&gt;
* [Her] Ha ok, you&#039;ve to fill Annex 3, (shouting behind her shoulder) JOSETTE, DO WE HAVE ANNEX 3???&lt;br /&gt;
* [Josette] ANNEX WHAT??&lt;br /&gt;
* [Me] No prob, look (and I pull out my own copy of [http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/03_-_FORMULAIRE_RENONCIATION_CERTIFS.pdf Annex 3 (pdf)])&lt;br /&gt;
* ... (meanwhile she has no idea what to do on the eID to fulfill renouncement and I agree with her, the Manual was unclear so we went for activation+revocation)&lt;br /&gt;
* [Me] No prob, look (and I pull out my own copy of [http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/10_-_Attestation_activ_Certificats(18-10)_27-07.pdf Annex 10 (pdf)])&lt;br /&gt;
* [Her] Can I take your copies before you fill them? I&#039;ll make copies for ourselves.&lt;br /&gt;
So today the official Annex 3&amp;amp;10 forms of this civil office are mine :-D&amp;lt;br&amp;gt;Who knows, maybe I crafted the form... ;-)&lt;br /&gt;
&lt;br /&gt;
It is &amp;quot;funny&amp;quot; to see that everywhere the activation of the certificates is presented as optional, the choice being left to the citizen, blablabla, but in reality most of the citizen just don&#039;t know about this possibility (and most of the civil servants, well I hope that since my story, things have evolved a bit) and the civil servants doesn&#039;t ask you the question.&lt;br /&gt;
&lt;br /&gt;
===Some details about those certificates===&lt;br /&gt;
The eID contains 2 signature certificates, so you cannot encrypt with them, just sign.&lt;br /&gt;
* One labeled &amp;quot;Authentication&amp;quot; is for daily use &lt;br /&gt;
** To log in on SSL websites such as [http://minfin.fgov.be/taxonweb/ Tax-on-web] or [http://www.saferchat.be SaferChat] or even your bank e.g. [http://www.keytradebank.com/pdf/eID_en.pdf Keytrade has implemented it (pdf)] with CRL check&lt;br /&gt;
** For signing mails with S/MIME&lt;br /&gt;
** For your own purpose, to log on your SSH server, SSL server, VPN etc&lt;br /&gt;
* One labeled &amp;quot;Signature&amp;quot; is for special cases&lt;br /&gt;
** It has a equivalent legal value as a hand-written signature and is referred as non-repudiation signature.&lt;br /&gt;
** According to [http://www.certipost.be/dpsolutions/images/stories/e-signing/right/applicability_en.pdf CertiPost applicability guidelines (pdf)], the electronic signature still cannot replace a hand-written signature in a number of cases&lt;br /&gt;
**It&#039;s automatically revoked for minors under 18 years as they cannot sign legally yet.&lt;br /&gt;
**From [http://www.certipost.be/dpsolutions/en/eid-faq.html Certipost FAQ]:&amp;lt;br&amp;gt;&#039;&#039;Non-repudiation guarantees that one cannot deny having performed an act. E.g. any message signed using a person&#039;s digital signature can only have come from this person. The signing person can not claim that the message was not originated by him.&amp;lt;br&amp;gt;In other words, non-repudiation means that information &#039;&#039;&#039;cannot be disclaimed&#039;&#039;&#039;, similar to a &#039;&#039;&#039;witnessed&#039;&#039;&#039; handwritten signature on a paper document.&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;to be checked in the law&#039;&#039;&lt;br /&gt;
** Normal pkcs software doesn&#039;t seem to be able to use it (?)&lt;br /&gt;
** Should be used only through the Government software which prompts you with a special GUI and warnings about the legal power of this signature&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/en/rem-overzicht.html CertiPost e-Registered mails] is using the non-repudiation signature&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/en/e-signing-overview.html CertiPost e-Signing] is using the non-repudiation signature&lt;br /&gt;
* Both are protected by the same PIN which is typed on your (unsafe) PC&lt;br /&gt;
&lt;br /&gt;
===What says the law===&lt;br /&gt;
Sorry, here are french version abstracts.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;9 JUILLET 2001. - Loi fixant certaines règles relatives au cadre juridique pour les signatures électroniques et les services de certification&#039;&#039;&#039;, date de publication au Moniteur: 29 septembre 2001&lt;br /&gt;
&amp;lt;br&amp;gt;Morceaux choisis:&lt;br /&gt;
* Art. 4. § 1er. A défaut de dispositions légales contraires, nul ne peut être contraint de poser un acte juridique par voie électronique.&lt;br /&gt;
* § 4. Sans préjudice des articles 1323 et suivants du Code civil, une signature électronique avancée réalisée sur la base d&#039;un certificat qualifié et conçue au moyen d&#039;un dispositif sécurisé de création de signature électronique, est assimilée à une signature manuscrite, qu&#039;elle soit réalisée par une personne physique ou morale.&lt;br /&gt;
* § 5. Une signature électronique ne peut être privée de son efficacité juridique et ne peut être refusée comme preuve en justice au seul motif :&lt;br /&gt;
** que la signature se présente sous forme électronique, ou&lt;br /&gt;
** qu&#039;elle ne repose pas sur un certificat qualifié, ou&lt;br /&gt;
** qu&#039;elle ne repose pas sur un certificat qualifié délivré par un prestataire accrédité de service de certification, ou&lt;br /&gt;
** qu&#039;elle n&#039;est pas créée par un dispositif sécurisé de création de signature.&lt;br /&gt;
* &#039;&#039;Wait a minute, ANY electronic signature NOT being based on a qualified certificate and NOT created in a secure environment CANNOT be refused as a legal proof???&amp;lt;br&amp;gt;Maybe it&#039;s me or the triple-negation sentences (lawyers, lawyers...) but it looks like § 5 goes much further than § 4&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===What do I think today?===&lt;br /&gt;
====Catastrophe scenario==== &lt;br /&gt;
* Someone captures your PIN while you&#039;re using it for &amp;quot;just authentication&amp;quot; via e.g. malware, virus, trojan, worm on the PC &lt;br /&gt;
** you know, the kind of stuff that never happens, anyway it&#039;s now [http://eid.belgium.be/fr/navigation/documents/39814.html your problem] even if the official middleware [http://blog.didierstevens.com/2007/12/31/how-can-i-trust-the-beid-runtime/ is not signed]&lt;br /&gt;
**And apparently even some readers with integrated keypads are [http://belsec.skynetblogs.be/post/5426553/belgian-eid-nr-11--keyloggers-work-with-eid not safer :-(]&lt;br /&gt;
**And apparently even commercial standalone smatcard terminals are [http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-711.pdf not safer :-( (pdf)]&lt;br /&gt;
**And, oh, I did a small test with [[Keyloggers|lkl, a userland keylogger]] and of course the PIN typed into the beid graphical prompt could be easily captured.&lt;br /&gt;
* He gets physical access to your eID, even briefly if he has e.g. a PDA with Internet &amp;amp; smartcard reader.&lt;br /&gt;
* Now he can sign with your legal signature anything you can imagine... and you cannot repudiate what he does.&lt;br /&gt;
* The fact that maybe legal signatures have to be crafted through CertiPost (cf e-signing below) doesn&#039;t change anything to this risk.&lt;br /&gt;
&lt;br /&gt;
====So what will I do next time?====&lt;br /&gt;
* I&#039;ll probably accept the Authentication certificate to be able to play around with it.&lt;br /&gt;
* For sure I&#039;ll revoke the Signature certificate unless they change their architecture.&lt;br /&gt;
** Not the same PIN than the other certificate.&lt;br /&gt;
** Better than 4 digits (&amp;amp; 3 attempts so 3 chances over 10000)&lt;br /&gt;
** Probably they limited themselves to one single small PIN in order to pass the [http://www.kafka.be Kafka test] ;-)&lt;br /&gt;
** Even then:&lt;br /&gt;
*** Then I could use it but only on trusted devices, that&#039;s another story...&lt;br /&gt;
*** You get the PIN &amp;amp; PUK by post if I remember well, this could be eavesdropped but you can change your PIN... So  as the PUK can unlock the PIN 12 times, the attacker has 36 chances over 10000, one over 278, mmm... And who said humans can generate random PINs? ;-)&lt;br /&gt;
&lt;br /&gt;
===Privacy and other security considerations===&lt;br /&gt;
* [http://idcorner.org/2005/07/04/the-belgian-eid-card-calamity/ Another] [http://www.idcorner.org/?p=121 consideration] I didn&#039;t talk about yet: PRIVACY&lt;br /&gt;
* Whoever sees your public certificate (which happens e.g. if you log to a SSL website with your card or &#039;&#039;&#039;if you simply send a signed email&#039;&#039;&#039;) sees your [http://www.ibz.rrn.fgov.be/ RRN (&amp;quot;rijksregistratienummer&amp;quot;)]&amp;lt;br&amp;gt;BTW here is [http://fr.wikipedia.org/wiki/Num%C3%A9ro_de_registre_national how it&#039;s constructed]: It is a total of 11 numbers of which the first 6 are your birthdate JJMMDD followed by three numbers to distinguish the people that were born on the same day (even for men, uneven for women) and the last two numbers are a control number. So if you know the birthdate and the sex of the person, and you know how the control sum is done (97-JJMMDDXXX%97), you only miss two and a half numbers coming from a linear incremental counter (001, 003,...) to recompile his national register number. For mine it takes less than 40 attempts it you proceed logically...&lt;br /&gt;
* [http://minfin.fgov.be/taxonweb/ Tax-on-web] announce it but what about the others and your mail correspondants?&amp;lt;br&amp;gt;&#039;&#039;Suite à l&#039;utilisation de votre moyen d&#039;authentification (carte d&#039;identité électronique ou token citoyen), le SPF Finances a connaissance de votre numéro de registre national.&amp;lt;br&amp;gt;Conformément à l&#039;arrêté royal du 25/04/1986 autorisant certaines autorités du Ministère des Finances à utiliser le numéro d&#039;identification du registre national des personnes physiques, votre numéro de registre national n&#039;est utilisé dans ce contexte qu&#039;à des fins d&#039;identification pour l&#039;accès aux applications du SPF Finances.&amp;lt;br&amp;gt;La loi du 8 décembre 1992 relative à la protection de la vie privée à l&#039;égard des traitements de données à caractère personnel s&#039;applique à ce traitement d&#039;identification dont le responsable est le SPF Finances, Boulevard Albert II, 33 à 1030 Bruxelles.&#039;&#039;&lt;br /&gt;
* Other &amp;quot;funny&amp;quot; facts: Belgium government doesn&#039;t bother about cross-certification with any common Root CA so when you want to visit an official site supposedly secured such as  https://ccff02.minfin.fgov.be/CCFF_Authentication/choseLoginMethod.do or https://mijndossier.rrn.fgov.be you&#039;re kindly asked to blindly trust the certificate, years after phishing was invented, sigh...&lt;br /&gt;
* And even &amp;quot;better&amp;quot;: for Firefox, [http://www.certipost.be/dpsolutions/en/e-signing-faq.html CertiPost e-Signing] requires you to download and install their CA certificate and to trust it for identifying everything: web sites, mail users and software! Here the download of the CA certificate is done... on pure http, sigh...&lt;br /&gt;
* [https://www.cosic.esat.kuleuven.be/adapid/ ADAPID project] is a consortium of researchers and industry representatives in Flanders decided to take action in an attempt to help avoid a national privacy calamity. After a first (non-public) report, the ADAPID project won the financial support of IWT-Flanders. ADAPID officially started July 1st, 2005 and will run until June 30th, 2009.&lt;br /&gt;
* Normally the third and definitive version of the eID should have been rolled out begin of this year (2008) but I&#039;ve no idea what are the changes.&lt;br /&gt;
* [http://www.cirb.irisnet.be/site/fr/eid/ethicalid/index_htm Ethical-ID] is a software which presents to the e.g. swimming pool employee the only relevant data e.g. the residence city.&lt;br /&gt;
&lt;br /&gt;
==My attempts under Linux==&lt;br /&gt;
I&#039;m using the [[IDream ID-SMID01 SmartCard reader]], bought for 10€&lt;br /&gt;
&lt;br /&gt;
Installing beidgui and dependencies:&lt;br /&gt;
 apt-get install beidgui beid-tools&lt;br /&gt;
 =&amp;gt; libopenct1 libpcsclite1 libbeidlibopensc2 libbeid2 beid-tools beidgui libccid pcscd &lt;br /&gt;
 less /usr/share/doc/libbeidlibopensc2/README.Debian&lt;br /&gt;
&lt;br /&gt;
The GUI application works well, including OCSP communication, showing me that my eID certificates are revoked, excellent!&lt;br /&gt;
&lt;br /&gt;
UPDATE: There is a version 2.6.0-3 available in unstable&lt;br /&gt;
 apt-get install -t unstable beidgui beid-tools&lt;br /&gt;
&lt;br /&gt;
There are 2 (optional) daemons provided with beid-tools:&lt;br /&gt;
* beidcrld&amp;lt;br&amp;gt;Automatic CRL download&lt;br /&gt;
* beidpcscd&amp;lt;br&amp;gt;The privacy filter monitors all commands sent to the card. When an application requests to read the identity data, address or photo from the eID card, the filter will display a message and ask the user&#039;s consent&amp;lt;br&amp;gt;it&#039;s listening on port tcp 2500 and beidcrld, firefox-bin and icedove-bin are constantly speaking with it...&lt;br /&gt;
&lt;br /&gt;
===Exploring===&lt;br /&gt;
 pkcs15-tool --dump&lt;br /&gt;
 pkcs15-tool --read-certificate 02 &amp;gt; my_auth.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 03 &amp;gt; my_sign.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 04 &amp;gt; belgium.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 06 &amp;gt;&amp;gt; belgium.crt&lt;br /&gt;
 openssl x509 -in my_auth.crt -text&lt;br /&gt;
 pkcs15-tool --read-ssh-key 2&lt;br /&gt;
 # For a little demo...&lt;br /&gt;
 beid-pkcs11-tool --slot 0 --login --test&lt;br /&gt;
There is also some java support but I couldn&#039;t try it yet.&lt;br /&gt;
&lt;br /&gt;
===Firefox security module===&lt;br /&gt;
To add the security module to Firefox:&lt;br /&gt;
 apt-get install libbeid2-dev libbeidlibopensc2-dev&lt;br /&gt;
Visit file:///usr/share/beid/beid-pkcs11-register.html to install the service&lt;br /&gt;
&lt;br /&gt;
Now what?...&lt;br /&gt;
&amp;lt;br&amp;gt;cf http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/eID-FR-Firefox.pdf&lt;br /&gt;
&amp;lt;br&amp;gt;You can see your certificate in Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; View Certificates and you can trust the Belgium Root CA under the &amp;quot;Authorities&amp;quot; tab for e.g. &amp;quot;identifying mail users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can then connect to federal sites like [http://minfin.fgov.be/taxonweb/ Tax-on-web] or the [https://mondossier.rrn.fgov.be RRN], being identified by your card &amp;amp; PIN.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that it works only if I start Firefox after having the eID in place in the reader.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that I didn&#039;t get much further, being redirected to e.g.&lt;br /&gt;
this nonexistent page but the title speaks for itself ;-) https://mondossier.rrn.fgov.be/CertificateRevoked.html&lt;br /&gt;
&lt;br /&gt;
===Thunderbird security module===&lt;br /&gt;
To add the security module to Firefox:&lt;br /&gt;
 apt-get install libbeid2-dev libbeidlibopensc2-dev&lt;br /&gt;
Menu preferences-&amp;gt;advanced-&amp;gt;certificates-&amp;gt;security devices-&amp;gt;load&lt;br /&gt;
 Module name: Belgium Identity Card PKCS#11&lt;br /&gt;
 Module filename: /usr/lib/libbeidpkcs11.so&lt;br /&gt;
&lt;br /&gt;
You can see your certificate in Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; View Certificates and you can trust the Belgium Root CA under the &amp;quot;Authorities&amp;quot; tab for e.g. &amp;quot;identifying mail users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Try to sign a first mail:&lt;br /&gt;
&amp;lt;br&amp;gt;Menu S-MIME -&amp;gt; Digitally sign this message -&amp;gt; setup certificate -&amp;gt; digital signing -&amp;gt; select your BELPIC auth certif&lt;br /&gt;
&lt;br /&gt;
I could successfully sign (with my PIN) and verify an email but only with the Authentication certificate, not the Signature certificate&lt;br /&gt;
&amp;lt;br&amp;gt;According to the snapshots of the official guide of the eID for Outlook, it&#039;s ok, the Authentication certificate must be used, the other being reserved for legal signatures.&lt;br /&gt;
&amp;lt;br&amp;gt;UPDATE: Well now that I saw that Wouter could sign with the signature certificate I tried again and indeed it works.&lt;br /&gt;
&lt;br /&gt;
One difficulty is that the certificate is not bound to an email address so the email client tells you sth like it&#039;s validly signed but no idea if the certificate owner corresponds to the sender email address.&lt;br /&gt;
&lt;br /&gt;
===Signing with pkcs15-crypt===&lt;br /&gt;
From https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/UsingOpenscTOC#using_opensc_smartcards_to_sign&lt;br /&gt;
&lt;br /&gt;
Signing text and extracting the public certificate:&lt;br /&gt;
 fortune &amp;gt; data.txt&lt;br /&gt;
 openssl sha1 -binary data.txt &amp;gt; data.sha1&lt;br /&gt;
 pkcs15-crypt --key 2 --sign --pkcs1 --sha-1 --input data.sha1 --output data.auth.sig&lt;br /&gt;
 pkcs15-tool --read-certificate 02 &amp;gt; my_auth.crt&lt;br /&gt;
&lt;br /&gt;
Verifying the signature:&lt;br /&gt;
 openssl x509 -in my_auth.crt -pubkey -noout &amp;gt; my_auth.pem&lt;br /&gt;
 openssl dgst -sha1 -verify my_auth.pem -signature data.auth.sig data.txt&lt;br /&gt;
&lt;br /&gt;
I tried to do the same with the signature certificate instead of the authentication certificate but I get an error:&lt;br /&gt;
 pkcs15-crypt --key 3 --sign --pkcs1 --sha-1 --input data.sha1 --output data.auth.sig&lt;br /&gt;
 [pkcs15-crypt] sec.c:67:sc_set_security_env: returning with: Not supported&lt;br /&gt;
 [pkcs15-crypt] pkcs15-sec.c:267:sc_pkcs15_compute_signature: sc_set_security_env() failed: Not supported&lt;br /&gt;
 Compute signature failed: Not supported&lt;br /&gt;
Indeed signing with the signature certificate and without a GUI showing a warning about the legal implication is forbidden.&lt;br /&gt;
&lt;br /&gt;
===Signing with GpgSM===&lt;br /&gt;
GpgSM is to X.509 what GnuPG is to OpenPGP, cf http://gnupg.org/aegypten/tech.en.html&lt;br /&gt;
&lt;br /&gt;
 apt-get install gpgsm dirmngr gnupg-agent pinentry-qt&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/gpg-agent.conf:&lt;br /&gt;
 no-grab&lt;br /&gt;
 default-cache-ttl 1800&lt;br /&gt;
 ignore-cache-for-signing&lt;br /&gt;
 allow-mark-trusted&lt;br /&gt;
&lt;br /&gt;
 ~/.bash_profile: (appending this stuff)&lt;br /&gt;
 # preparing gpg-agent:&lt;br /&gt;
 if test -f $HOME/.gpg-agent-info &amp;amp;&amp;amp; kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2&amp;gt;/dev/null; then&lt;br /&gt;
   GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info`&lt;br /&gt;
   export GPG_AGENT_INFO&lt;br /&gt;
 else&lt;br /&gt;
   eval `gpg-agent --daemon`&lt;br /&gt;
   echo $GPG_AGENT_INFO &amp;gt;$HOME/.gpg-agent-info&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/scdaemon.conf: (we disable internal CCID support as only libccid supports more or less my crappy reader)&lt;br /&gt;
 disable-ccid&lt;br /&gt;
 debug-level none&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/gpgsm.conf:&lt;br /&gt;
 debug-level none&lt;br /&gt;
&lt;br /&gt;
Acquiring the certificates:&lt;br /&gt;
 $ gpgsm --learn-card&lt;br /&gt;
Actually I had to run it several times, the first time only the Belgium CA was extracted, then the Citizen CA and finally the 2 personal certificates. And the behavior is not really reproductible so you&#039;ve to run it till you&#039;ve the 4 certificates:&lt;br /&gt;
 $ gpgsm --list-keys&lt;br /&gt;
 /home/phil/.gnupg/pubring.kbx&lt;br /&gt;
 -----------------------------&lt;br /&gt;
      Subject: /CN=Belgium Root CA/C=BE&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Citizen CA/C=BE/SerialNumber=200507&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Philippe Teuwen (Authentication)/C=BE/SerialNumber=...&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Philippe Teuwen (Signature)/C=BE/SerialNumber=...&lt;br /&gt;
To sign sth:&lt;br /&gt;
 $ gpgsm --sign mail.txt&lt;br /&gt;
Then I get prompted to trust Belgium CA and gpgsm fails &amp;quot;error creating signature: Certificat révoqué &amp;lt;GpgSM&amp;gt;&amp;quot;, normal.&lt;br /&gt;
&amp;lt;br&amp;gt;During trusting the Belgium CA, it created automatically a .gnupg/trustlist.txt with&lt;br /&gt;
 # CN=Belgium Root CA,C=BE&lt;br /&gt;
 DF:DF:AC:89:47:BD:F7:52:64:A9:23:3A:C1:0E:E3:D1:28:33:DA:CC S&lt;br /&gt;
&lt;br /&gt;
Ok let&#039;s try again without the CRLs check:&lt;br /&gt;
 $ gpgsm --disable-crl-checks --armor --sign --output mail.txt.smime mail.txt&lt;br /&gt;
 [...]&lt;br /&gt;
 gpgsm: signature created&lt;br /&gt;
I was prompted for my PIN during the process.&lt;br /&gt;
&lt;br /&gt;
And trying to verify, with CRLs:&lt;br /&gt;
 $ gpgsm --verify --output mail.txt mail.txt.smime&lt;br /&gt;
 gpgsm: Signature made 2008-02-06 21:42:40 using certificate ID 0x80211056&lt;br /&gt;
 gpgsm: note: non-critical certificate policy not allowed&lt;br /&gt;
 dirmngr[8994]: error opening `/home/phil/.gnupg/dirmngr_ldapservers.conf&#039;: Aucun fichier ou répertoire de ce type&lt;br /&gt;
 dirmngr[8994]: permanently loaded certificates: 0&lt;br /&gt;
 dirmngr[8994]:     runtime cached certificates: 0&lt;br /&gt;
 dirmngr[8994]: command ISVALID failed: Certificat révoqué&lt;br /&gt;
 gpgsm: certificate #100000000000E144CBC42E9BB2453EE4/2.5.4.5=#323030353037,CN=Citizen CA,C=BE&lt;br /&gt;
 gpgsm: certificate has been revoked&lt;br /&gt;
 gpgsm: invalid certification chain: Certificat révoqué&lt;br /&gt;
And without CRLs:&lt;br /&gt;
 $ gpgsm --disable-crl-checks --verify --output mail.txt mail.txt.smime          &lt;br /&gt;
 gpgsm: Signature made 2008-02-06 21:42:40 using certificate ID 0x80211056&lt;br /&gt;
 gpgsm: CRLs not checked due to --disable-crl-checks option&lt;br /&gt;
 gpgsm: Good signature from &amp;quot;/CN=Philippe Teuwen (Authentication)/C=BE/SerialNumber=...&lt;br /&gt;
&lt;br /&gt;
===e-Signing plugin for Firefox===&lt;br /&gt;
* pure curiosity...&lt;br /&gt;
* cf http://www.certipost.be/dpsolutions/en/e-signing-faq.html&lt;br /&gt;
* the plugin is signed so you&#039;ve to install the CA certificate of Certipost first and, cf above in my &amp;quot;funny facts&amp;quot;, for Firefox, you&#039;ve to download and... trust it.&amp;lt;br&amp;gt;The certificate is apparently no longer (broken link) and I could not find it in their search tool, the only thing I could find is [http://64.233.183.104/search?q=cache:vzHK3UKTuiMJ:www.certipost.be/en/certificates/PrimaryNormalisedCA/certificate_pem.cer+PrimaryNormalisedCA&amp;amp;hl=fr&amp;amp;ct=clnk&amp;amp;cd=3&amp;amp;gl=fr a copy of the pem version in Google cache(!)]&amp;lt;br&amp;gt;but that was good enough to be able to install the plugin.&lt;br /&gt;
* Moreover [https://connect.e-signing.be/app/en/create the form to sign] wants to directly execute some jar file but under an SSL connection signed by... the so-hard-to-get Certipost CA certificate, itself signed by GTE CyberTrust Global Root, an authority built-in in the browsers.&lt;br /&gt;
* You&#039;ve [https://www.certipost.be/webshop/ to pay] to be able to sign with your eID non-repudiation signature to have a valid &#039;&#039;Qualified Electronic Signature with long term value&#039;&#039;&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/images/stories/e-signing/right/technical_measures_en.pdf There are some explanations] of the additional services provided by CertiPost:&amp;lt;br&amp;gt;&#039;&#039;The applied XAdES-X-L is an XML signature format according to the recognized XAdES standard (ETSI TS 101 903 standard) that implements measures to satisfy the legal requirements for advanced electronic signatures as defined in the European Directive (EC 1999/93: European Community (EC) DIRECTIVE 1999/93/EC OF THE EUROPEAN PARLIAMENT AND COUNCIL ON A COMMUNITY FRAMEWORK FOR ELECTRONIC SIGNATURES) and for long term non-repudiation. Next to the electronic signature itself, the XAdES-X-Lfile contains the certificate that was used during the signature, the information to proof whether the certificate was valid when signing, and a time stamp to proof that all information used for signing existed and not altered since.&amp;lt;br&amp;gt;Moreover CertiPost keeps a copy of the signed information.&lt;br /&gt;
* Timestamps &amp;amp; storage look like additional features, not mandated by the law, so can I create a &#039;&#039;Qualified Electronic Signature with long term value&#039;&#039; out of the CertiPost context, so just a plain x509 signature?&lt;br /&gt;
&lt;br /&gt;
===SSH===&lt;br /&gt;
Inspired from http://simi.be/?page_id=9&lt;br /&gt;
&lt;br /&gt;
Getting the patch from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=355274 and porting it to v4.7p1&lt;br /&gt;
&amp;lt;br&amp;gt;Some rejs easy to solve from v4.2 to v4.7 and one less obvious change in debian/control: fix the debconf dependancies (was ${debconf:Depends} I think):&lt;br /&gt;
 Package: openssh-client-sc                                                          &lt;br /&gt;
 Architecture: any                                                                   &lt;br /&gt;
 Depends: ${shlibs:Depends}, debconf (&amp;gt;= 1.2.0) | debconf-2.0,...&lt;br /&gt;
&amp;lt;br&amp;gt;I recompile ssh with smartcard support.&lt;br /&gt;
 apt-get source openssh-client&lt;br /&gt;
 cd openssh-4.7p1&lt;br /&gt;
 patch -p1 &amp;lt; ../mypatch&lt;br /&gt;
 dpkg-buildpackage -uc -us -rfakeroot&lt;br /&gt;
Sending my public key to the ssh server:&lt;br /&gt;
 pkcs15-tool --read-ssh-key 2 |tail -n1|ssh user@host &#039;cat - &amp;gt;&amp;gt; ~/.ssh/authorized_keys&#039;&lt;br /&gt;
Then logging, being prompted for my PIN:&lt;br /&gt;
 ssh -I 0 user@host.com&lt;br /&gt;
===OpenID===&lt;br /&gt;
cf [[OpenID]] and [[OpenID-eID]] where I&#039;m hacking phpMyID to make my own&lt;br /&gt;
&lt;br /&gt;
===TODO: Login===&lt;br /&gt;
I tried https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/UsingOpenscTOC#logging_in_with_smartcards&lt;br /&gt;
but with the eID.&lt;br /&gt;
 apt-get install libpam-p11&lt;br /&gt;
See file:///usr/share/doc/libpam-p11/QuickStart.html&lt;br /&gt;
&amp;lt;br&amp;gt;Bad side: it conflicts with xlockmore :-(&lt;br /&gt;
&lt;br /&gt;
openssh way:&lt;br /&gt;
&amp;lt;br&amp;gt;Preparing the account with .ssh/authorized_keys, cf SSH auth on this page&lt;br /&gt;
&amp;lt;br&amp;gt;Edit /etc/pam.d/login and add before &amp;quot;@include common-auth&amp;quot; sth like:&lt;br /&gt;
 auth sufficient pam_p11_openssh.so /usr/lib/opensc-pkcs11.so&lt;br /&gt;
/var/log/auth.log tells: no certificates found&lt;br /&gt;
or&lt;br /&gt;
 auth sufficient pam_p11_openssh.so /usr/lib/libbeidpkcs11.so&lt;br /&gt;
/var/log/auth.log tells: fatal: pkcs11_sign failed &lt;br /&gt;
&amp;lt;br&amp;gt;before I was even prompted for my PIN&lt;br /&gt;
&lt;br /&gt;
opensc way: same results&lt;br /&gt;
 auth sufficient pam_p11_opensc.so /usr/lib/opensc-pkcs11.so&lt;br /&gt;
 auth sufficient pam_p11_opensc.so /usr/lib/libbeidpkcs11.so&lt;br /&gt;
preparing the account:&lt;br /&gt;
 mkdir ~/.eid&lt;br /&gt;
 chmod 0755 ~/.eid&lt;br /&gt;
 pkcs15-tool -r 2 &amp;gt; ~/.eid/authorized_certificates&lt;br /&gt;
 chmod 0644 ~/.eid/authorized_certificates&lt;br /&gt;
&lt;br /&gt;
So I still couldn&#039;t find a way.&lt;br /&gt;
&lt;br /&gt;
===TODO: SSL Auth===&lt;br /&gt;
http://blog.eikke.com/index.php/ikke/2007/10/29/using_your_belgian_eid_for_ssl_authentic&lt;br /&gt;
&lt;br /&gt;
 apt-get install libengine-pkcs11-openssl&lt;br /&gt;
&lt;br /&gt;
To generate a request, open a console and launch openssl. Once at the OpenSSL prompt, issue these 2 commands:&lt;br /&gt;
 engine -t dynamic -pre SO_PATH:/usr/lib/engines/engine_pkcs11.so -pre ID:pkcs11 -pre LIST_ADD:1 -pre LOAD -pre MODULE_PATH:/usr/lib/opensc-pkcs11.so&lt;br /&gt;
Adjust paths if necessary, of course. This loads the pkcs11 engine inside OpenSSL.&lt;br /&gt;
 req -engine pkcs11 -new -days 100 -key id_02 -keyform engine -out myrequest.csr -subj &amp;quot;/C=BE/ST=O-VL/O=My Organisation/CN=My Name/emailAddress=my@email.tld&amp;quot;&lt;br /&gt;
Adjust the days, out and subj parameters, at least. The key ID can be found using&lt;br /&gt;
 pkcs15-tool -c&lt;br /&gt;
Use the ID of the Authentication X509 certificate.&lt;br /&gt;
&lt;br /&gt;
===TODO: Apache SSL Reverse Proxy===&lt;br /&gt;
cf http://www.belgium.be/zip/eid_authentication_proxy_fr.html&lt;br /&gt;
===TODO: OpenGPG &amp;amp; x509===&lt;br /&gt;
Old dream is to sign an OpenPGP key with the eID, but even if technically possible, it probably breaks the validation chain as what Citizen CA signed was the entire certificate, not just the key/uid.&lt;br /&gt;
&amp;lt;br&amp;gt;Sth to check: [http://www.imc.org/ietf-openpgp/mail-archive/msg09930.html OpenPGP Signatures Incorporating X.509 Certificates]&lt;br /&gt;
&amp;lt;br&amp;gt;The solution is apparently to extend OpenGPG to allow special signatures on UIDs with sub-packets containing the entire certificate, the UID being build from the DN fields of the certificate (CN, EMAIL,...)&lt;br /&gt;
&amp;lt;br&amp;gt;Apparently PGP supports it already?&lt;br /&gt;
&lt;br /&gt;
===TODO: OpenVPN Auth===&lt;br /&gt;
http://christophe.vandeplas.com/2008/02/03/openvpn-belgian-eid&lt;br /&gt;
&amp;lt;br&amp;gt;But Debian openvpn 2.1_cr4 doesn&#039;t support yet --show-pkcs11-ids&lt;br /&gt;
===TODO: Other tools===&lt;br /&gt;
* [http://sourceforge.net/projects/opensignature OpenSignature] for Italia&lt;br /&gt;
* [http://openportalguard.sourceforge.net/ Open Portal Guard] for e.g. public administrations&lt;br /&gt;
* beidcrld: where are CRLs downloaded to?&lt;br /&gt;
* beidpcscd: how to test it?&lt;br /&gt;
* beidlib.jar &amp;amp; java applet...&lt;/div&gt;</summary>
		<author><name>212.71.5.64</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=2941</id>
		<title>Belgian eID</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=2941"/>
		<updated>2008-03-05T07:41:23Z</updated>

		<summary type="html">&lt;p&gt;212.71.5.64: /* My attempts under Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Belgian eID is part of the efforts of the government for [[Belgian eGov]]&lt;br /&gt;
==Officials==&lt;br /&gt;
&lt;br /&gt;
* [http://eid.belgium.be Official eID portal]&lt;br /&gt;
* [http://repository.eid.belgium.be/FR/Index.htm Certificates]&lt;br /&gt;
* [http://status.eid.belgium.be/ eID services]&lt;br /&gt;
* [http://crl.eid.belgium.be/ Revocation lists] and [http://ocsp.eid.belgium.be/ OCSP server]&lt;br /&gt;
* [http://eid.belgium.be/fr/navigation/documents/37129.html Circulaires (fr) eID Home  /  Villes et communes  /  Quoi  /  Circulaires]&amp;lt;br&amp;gt;Among others:&amp;lt;br&amp;gt; 3) FORMULAIRE DE RENONCIATION AUX CERTIFICATS DE LA CARTE D’IDENTITE ELECTRONIQUE AU MOMENT DE LA DEMANDE DE LA CARTE&amp;lt;br&amp;gt;10) MODELE D’ATTESTATION D’ACTIVATION OU DE REVOCATION DES CERTIFICATS APRES ACTIVATION DE LA CARTE&amp;lt;br&amp;gt;11) MODELE D’ATTESTATION DE SUSPENSION ET DE REACTIVATION DES CERTIFICATS&lt;br /&gt;
* [http://www.certipost.be CertiPost], by Belgacom &amp;amp; La Poste/De Post&lt;br /&gt;
** [http://www.certipost.be/x500/X500.html Certipost E-Trust™ Public X500 Directory Search]&lt;br /&gt;
&lt;br /&gt;
==Usage &amp;amp; Software==&lt;br /&gt;
&lt;br /&gt;
* [http://www.belgium.be/zip/eid_datacapture_fr.html Middleware &amp;amp; developer&#039;s kit]&lt;br /&gt;
** There are also Debian packages, cf below my tests under Linux&lt;br /&gt;
** [http://developer.novell.com/wiki/index.php/EID-belgium eID configuration toolkit by Novell]&lt;br /&gt;
* [http://homes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/WebHome Danny De Cock&#039;s page on eID] (same as http://www.godot.be)&lt;br /&gt;
* [http://weblogs.asp.net/cumpsd/archive/2005/04/03/396900.aspx short intro]&lt;br /&gt;
* [http://weblogs.asp.net/cumpsd/archive/2005/04/03/396901.aspx how to use the eID card within your .NET apps]&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
* http://www.foo.be/eID/ Official data, spec sheet etc (outdated)&lt;br /&gt;
* [http://belsec.skynetblogs.be/tag/1/E-ID Belsec blog entries] about the eID&lt;br /&gt;
* [http://www.uvcw.be/no_index/e-communes/dossier_eid/Belgian_eID_Run-time_Users_guide.pdf Belgian E-ID runtime guide windows/linux pdf]&lt;br /&gt;
* [http://www.porvoo8.rrn.fgov.be/porvoo8/doc13/09_porvoo8-bruegger18_Italy.pdf Open source interoperability and E-ID pdf]&lt;br /&gt;
* [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/5%20aspects%20techniques/fr/belpic_eid_version_numbering_v1.5.2.pdf The versioning of E-ID pdf]&lt;br /&gt;
* [http://porvoo10.net/p10/10_porvoo10-bud-25.pdf The road to European E-ID interoperability pdf]&lt;br /&gt;
* [http://www.microsoft.com/belux/nl/eid/ Microsoft and the eID], just an old marketing buzz? (I wouldn&#039;t complain...)&lt;br /&gt;
* [http://samba.grep.be/~wouter/beid-screencast.ogg], BeID screencast of what should have been shown at Fosdem 2008, by Wouter. (still waiting for the video of the presentation...)&lt;br /&gt;
* [http://www.lalibre.be/societe/cyber/article/404626/la-carte-d-identite-electronique-permettra-de-s-enregistrer-sur-ebay.html] La carte d&#039;identité électronique permettra de s&#039;enregistrer sur eBay&lt;br /&gt;
&lt;br /&gt;
==I revoked my certificates==&lt;br /&gt;
===Why?===&lt;br /&gt;
Because at that time I knew too few on the details of the eID architecture and too much about how a new security architecture can have flaws, so better to stay away for a while, especially given the legal implications that the eID can bring.&amp;lt;br&amp;gt;I knew they were talking about two certificates without understanding their difference, so let&#039;s revoke both.&amp;lt;br&amp;gt;Note that it doesn&#039;t mean my eID is not valid, eID card activation is mandatory. The eID card is a proof of identity and residence of a person in Belgium. eID certificates activation is a choice of the holder of the eID (opt-in), he/she can decide to activate or revoke the certificates. (cf [http://www.certipost.be/dpsolutions/en/eid-faq.html FAQ])&lt;br /&gt;
===How?===&lt;br /&gt;
It was quite epic.&lt;br /&gt;
&amp;lt;br&amp;gt;I was still a bit prepared, hopefully, so I had printed the Annexes 3 &amp;amp; 10, the legal forms to ask either to renounce to have the certificates or to revoke them just after activation, as well as the relevant parts of the User Manual for the civil servants :-)&lt;br /&gt;
&amp;lt;br&amp;gt;I printed both as for me it was not clear from the User Manual how to renounce for the certificates.&lt;br /&gt;
* [Me] Good morning, I come for my eID and... I want to get rid of the certificates&lt;br /&gt;
* [Her] You what? Is it possible? Never heard about that&lt;br /&gt;
* [Me] Yes, yes, see (and I show her what&#039;s in her User Manual)&lt;br /&gt;
* ... (takes a while to digest the info)&lt;br /&gt;
* [Her] Ha ok, you&#039;ve to fill Annex 3, (shouting behind her shoulder) JOSETTE, DO WE HAVE ANNEX 3???&lt;br /&gt;
* [Josette] ANNEX WHAT??&lt;br /&gt;
* [Me] No prob, look (and I pull out my own copy of [http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/03_-_FORMULAIRE_RENONCIATION_CERTIFS.pdf Annex 3 (pdf)])&lt;br /&gt;
* ... (meanwhile she has no idea what to do on the eID to fulfill renouncement and I agree with her, the Manual was unclear so we went for activation+revocation)&lt;br /&gt;
* [Me] No prob, look (and I pull out my own copy of [http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/10_-_Attestation_activ_Certificats(18-10)_27-07.pdf Annex 10 (pdf)])&lt;br /&gt;
* [Her] Can I take your copies before you fill them? I&#039;ll make copies for ourselves.&lt;br /&gt;
So today the official Annex 3&amp;amp;10 forms of this civil office are mine :-D&amp;lt;br&amp;gt;Who knows, maybe I crafted the form... ;-)&lt;br /&gt;
&lt;br /&gt;
It is &amp;quot;funny&amp;quot; to see that everywhere the activation of the certificates is presented as optional, the choice being left to the citizen, blablabla, but in reality most of the citizen just don&#039;t know about this possibility (and most of the civil servants, well I hope that since my story, things have evolved a bit) and the civil servants doesn&#039;t ask you the question.&lt;br /&gt;
&lt;br /&gt;
===Some details about those certificates===&lt;br /&gt;
The eID contains 2 signature certificates, so you cannot encrypt with them, just sign.&lt;br /&gt;
* One labeled &amp;quot;Authentication&amp;quot; is for daily use &lt;br /&gt;
** To log in on SSL websites such as [http://minfin.fgov.be/taxonweb/ Tax-on-web] or [http://www.saferchat.be SaferChat] or even your bank e.g. [http://www.keytradebank.com/pdf/eID_en.pdf Keytrade has implemented it (pdf)] with CRL check&lt;br /&gt;
** For signing mails with S/MIME&lt;br /&gt;
** For your own purpose, to log on your SSH server, SSL server, VPN etc&lt;br /&gt;
* One labeled &amp;quot;Signature&amp;quot; is for special cases&lt;br /&gt;
** It has a equivalent legal value as a hand-written signature and is referred as non-repudiation signature.&lt;br /&gt;
** According to [http://www.certipost.be/dpsolutions/images/stories/e-signing/right/applicability_en.pdf CertiPost applicability guidelines (pdf)], the electronic signature still cannot replace a hand-written signature in a number of cases&lt;br /&gt;
**It&#039;s automatically revoked for minors under 18 years as they cannot sign legally yet.&lt;br /&gt;
**From [http://www.certipost.be/dpsolutions/en/eid-faq.html Certipost FAQ]:&amp;lt;br&amp;gt;&#039;&#039;Non-repudiation guarantees that one cannot deny having performed an act. E.g. any message signed using a person&#039;s digital signature can only have come from this person. The signing person can not claim that the message was not originated by him.&amp;lt;br&amp;gt;In other words, non-repudiation means that information &#039;&#039;&#039;cannot be disclaimed&#039;&#039;&#039;, similar to a &#039;&#039;&#039;witnessed&#039;&#039;&#039; handwritten signature on a paper document.&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;to be checked in the law&#039;&#039;&lt;br /&gt;
** Normal pkcs software doesn&#039;t seem to be able to use it (?)&lt;br /&gt;
** Should be used only through the Government software which prompts you with a special GUI and warnings about the legal power of this signature&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/en/rem-overzicht.html CertiPost e-Registered mails] is using the non-repudiation signature&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/en/e-signing-overview.html CertiPost e-Signing] is using the non-repudiation signature&lt;br /&gt;
* Both are protected by the same PIN which is typed on your (unsafe) PC&lt;br /&gt;
&lt;br /&gt;
===What says the law===&lt;br /&gt;
Sorry, here are french version abstracts.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;9 JUILLET 2001. - Loi fixant certaines règles relatives au cadre juridique pour les signatures électroniques et les services de certification&#039;&#039;&#039;, date de publication au Moniteur: 29 septembre 2001&lt;br /&gt;
&amp;lt;br&amp;gt;Morceaux choisis:&lt;br /&gt;
* Art. 4. § 1er. A défaut de dispositions légales contraires, nul ne peut être contraint de poser un acte juridique par voie électronique.&lt;br /&gt;
* § 4. Sans préjudice des articles 1323 et suivants du Code civil, une signature électronique avancée réalisée sur la base d&#039;un certificat qualifié et conçue au moyen d&#039;un dispositif sécurisé de création de signature électronique, est assimilée à une signature manuscrite, qu&#039;elle soit réalisée par une personne physique ou morale.&lt;br /&gt;
* § 5. Une signature électronique ne peut être privée de son efficacité juridique et ne peut être refusée comme preuve en justice au seul motif :&lt;br /&gt;
** que la signature se présente sous forme électronique, ou&lt;br /&gt;
** qu&#039;elle ne repose pas sur un certificat qualifié, ou&lt;br /&gt;
** qu&#039;elle ne repose pas sur un certificat qualifié délivré par un prestataire accrédité de service de certification, ou&lt;br /&gt;
** qu&#039;elle n&#039;est pas créée par un dispositif sécurisé de création de signature.&lt;br /&gt;
* &#039;&#039;Wait a minute, ANY electronic signature NOT being based on a qualified certificate and NOT created in a secure environment CANNOT be refused as a legal proof???&amp;lt;br&amp;gt;Maybe it&#039;s me or the triple-negation sentences (lawyers, lawyers...) but it looks like § 5 goes much further than § 4&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===What do I think today?===&lt;br /&gt;
====Catastrophe scenario==== &lt;br /&gt;
* Someone captures your PIN while you&#039;re using it for &amp;quot;just authentication&amp;quot; via e.g. malware, virus, trojan, worm on the PC &lt;br /&gt;
** you know, the kind of stuff that never happens, anyway it&#039;s now [http://eid.belgium.be/fr/navigation/documents/39814.html your problem] even if the official middleware [http://blog.didierstevens.com/2007/12/31/how-can-i-trust-the-beid-runtime/ is not signed]&lt;br /&gt;
**And apparently even some readers with integrated keypads are [http://belsec.skynetblogs.be/post/5426553/belgian-eid-nr-11--keyloggers-work-with-eid not safer :-(]&lt;br /&gt;
**And apparently even commercial standalone smatcard terminals are [http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-711.pdf not safer :-( (pdf)]&lt;br /&gt;
**And, oh, I did a small test with [[Keyloggers|lkl, a userland keylogger]] and of course the PIN typed into the beid graphical prompt could be easily captured.&lt;br /&gt;
* He gets physical access to your eID, even briefly if he has e.g. a PDA with Internet &amp;amp; smartcard reader.&lt;br /&gt;
* Now he can sign with your legal signature anything you can imagine... and you cannot repudiate what he does.&lt;br /&gt;
* The fact that maybe legal signatures have to be crafted through CertiPost (cf e-signing below) doesn&#039;t change anything to this risk.&lt;br /&gt;
&lt;br /&gt;
====So what will I do next time?====&lt;br /&gt;
* I&#039;ll probably accept the Authentication certificate to be able to play around with it.&lt;br /&gt;
* For sure I&#039;ll revoke the Signature certificate unless they change their architecture.&lt;br /&gt;
** Not the same PIN than the other certificate.&lt;br /&gt;
** Better than 4 digits (&amp;amp; 3 attempts so 3 chances over 10000)&lt;br /&gt;
** Probably they limited themselves to one single small PIN in order to pass the [http://www.kafka.be Kafka test] ;-)&lt;br /&gt;
** Even then:&lt;br /&gt;
*** Then I could use it but only on trusted devices, that&#039;s another story...&lt;br /&gt;
*** You get the PIN &amp;amp; PUK by post if I remember well, this could be eavesdropped but you can change your PIN... So  as the PUK can unlock the PIN 12 times, the attacker has 36 chances over 10000, one over 278, mmm... And who said humans can generate random PINs? ;-)&lt;br /&gt;
&lt;br /&gt;
===Privacy and other security considerations===&lt;br /&gt;
* [http://idcorner.org/2005/07/04/the-belgian-eid-card-calamity/ Another] [http://www.idcorner.org/?p=121 consideration] I didn&#039;t talk about yet: PRIVACY&lt;br /&gt;
* Whoever sees your public certificate (which happens e.g. if you log to a SSL website with your card or &#039;&#039;&#039;if you simply send a signed email&#039;&#039;&#039;) sees your [http://www.ibz.rrn.fgov.be/ RRN (&amp;quot;rijksregistratienummer&amp;quot;)]&amp;lt;br&amp;gt;BTW here is [http://fr.wikipedia.org/wiki/Num%C3%A9ro_de_registre_national how it&#039;s constructed]: It is a total of 11 numbers of which the first 6 are your birthdate JJMMDD followed by three numbers to distinguish the people that were born on the same day (even for men, uneven for women) and the last two numbers are a control number. So if you know the birthdate and the sex of the person, and you know how the control sum is done (97-JJMMDDXXX%97), you only miss two and a half numbers coming from a linear incremental counter (001, 003,...) to recompile his national register number. For mine it takes less than 40 attempts it you proceed logically...&lt;br /&gt;
* [http://minfin.fgov.be/taxonweb/ Tax-on-web] announce it but what about the others and your mail correspondants?&amp;lt;br&amp;gt;&#039;&#039;Suite à l&#039;utilisation de votre moyen d&#039;authentification (carte d&#039;identité électronique ou token citoyen), le SPF Finances a connaissance de votre numéro de registre national.&amp;lt;br&amp;gt;Conformément à l&#039;arrêté royal du 25/04/1986 autorisant certaines autorités du Ministère des Finances à utiliser le numéro d&#039;identification du registre national des personnes physiques, votre numéro de registre national n&#039;est utilisé dans ce contexte qu&#039;à des fins d&#039;identification pour l&#039;accès aux applications du SPF Finances.&amp;lt;br&amp;gt;La loi du 8 décembre 1992 relative à la protection de la vie privée à l&#039;égard des traitements de données à caractère personnel s&#039;applique à ce traitement d&#039;identification dont le responsable est le SPF Finances, Boulevard Albert II, 33 à 1030 Bruxelles.&#039;&#039;&lt;br /&gt;
* Other &amp;quot;funny&amp;quot; facts: Belgium government doesn&#039;t bother about cross-certification with any common Root CA so when you want to visit an official site supposedly secured such as  https://ccff02.minfin.fgov.be/CCFF_Authentication/choseLoginMethod.do or https://mijndossier.rrn.fgov.be you&#039;re kindly asked to blindly trust the certificate, years after phishing was invented, sigh...&lt;br /&gt;
* And even &amp;quot;better&amp;quot;: for Firefox, [http://www.certipost.be/dpsolutions/en/e-signing-faq.html CertiPost e-Signing] requires you to download and install their CA certificate and to trust it for identifying everything: web sites, mail users and software! Here the download of the CA certificate is done... on pure http, sigh...&lt;br /&gt;
* [https://www.cosic.esat.kuleuven.be/adapid/ ADAPID project] is a consortium of researchers and industry representatives in Flanders decided to take action in an attempt to help avoid a national privacy calamity. After a first (non-public) report, the ADAPID project won the financial support of IWT-Flanders. ADAPID officially started July 1st, 2005 and will run until June 30th, 2009.&lt;br /&gt;
* Normally the third and definitive version of the eID should have been rolled out begin of this year (2008) but I&#039;ve no idea what are the changes.&lt;br /&gt;
* [http://www.cirb.irisnet.be/site/fr/eid/ethicalid/index_htm Ethical-ID] is a software which presents to the e.g. swimming pool employee the only relevant data e.g. the residence city.&lt;br /&gt;
&lt;br /&gt;
==My attempts under Linux==&lt;br /&gt;
I&#039;m using the [[IDream ID-SMID01 SmartCard reader]], bought for 10€&lt;br /&gt;
&lt;br /&gt;
Installing beidgui and dependencies:&lt;br /&gt;
 apt-get install beidgui beid-tools&lt;br /&gt;
 =&amp;gt; libopenct1 libpcsclite1 libbeidlibopensc2 libbeid2 beid-tools beidgui libccid pcscd &lt;br /&gt;
 less /usr/share/doc/libbeidlibopensc2/README.Debian&lt;br /&gt;
&lt;br /&gt;
The GUI application works well, including OCSP communication, showing me that my eID certificates are revoked, excellent!&lt;br /&gt;
&lt;br /&gt;
UPDATE: There is a version 2.6.0-3 available in unstable&lt;br /&gt;
 apt-get install -t unstable beidgui beid-tools&lt;br /&gt;
&lt;br /&gt;
There are 2 (optional) daemons provided with beid-tools:&lt;br /&gt;
* beidcrld&amp;lt;br&amp;gt;Automatic CRL download&lt;br /&gt;
* beidpcscd&amp;lt;br&amp;gt;The privacy filter monitors all commands sent to the card. When an application requests to read the identity data, address or photo from the eID card, the filter will display a message and ask the user&#039;s consent&amp;lt;br&amp;gt;it&#039;s listening on port tcp 2500 and beidcrld, firefox-bin and icedove-bin are constantly speaking with it...&lt;br /&gt;
&lt;br /&gt;
===Exploring===&lt;br /&gt;
 pkcs15-tool --dump&lt;br /&gt;
 pkcs15-tool --read-certificate 02 &amp;gt; my_auth.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 03 &amp;gt; my_sign.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 04 &amp;gt; belgium.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 06 &amp;gt;&amp;gt; belgium.crt&lt;br /&gt;
 openssl x509 -in my_auth.crt -text&lt;br /&gt;
 pkcs15-tool --read-ssh-key 2&lt;br /&gt;
 # For a little demo...&lt;br /&gt;
 beid-pkcs11-tool --slot 0 --login --test&lt;br /&gt;
There is also some java support but I couldn&#039;t try it yet.&lt;br /&gt;
&lt;br /&gt;
===Firefox security module===&lt;br /&gt;
To add the security module to Firefox:&lt;br /&gt;
 apt-get install libbeid2-dev libbeidlibopensc2-dev&lt;br /&gt;
Visit file:///usr/share/beid/beid-pkcs11-register.html to install the service&lt;br /&gt;
&lt;br /&gt;
Now what?...&lt;br /&gt;
&amp;lt;br&amp;gt;cf http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/eID-FR-Firefox.pdf&lt;br /&gt;
&amp;lt;br&amp;gt;You can see your certificate in Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; View Certificates and you can trust the Belgium Root CA under the &amp;quot;Authorities&amp;quot; tab for e.g. &amp;quot;identifying mail users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can then connect to federal sites like [http://minfin.fgov.be/taxonweb/ Tax-on-web] or the [https://mondossier.rrn.fgov.be RRN], being identified by your card &amp;amp; PIN.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that it works only if I start Firefox after having the eID in place in the reader.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that I didn&#039;t get much further, being redirected to e.g.&lt;br /&gt;
this nonexistent page but the title speaks for itself ;-) https://mondossier.rrn.fgov.be/CertificateRevoked.html&lt;br /&gt;
&lt;br /&gt;
===Thunderbird security module===&lt;br /&gt;
To add the security module to Firefox:&lt;br /&gt;
 apt-get install libbeid2-dev libbeidlibopensc2-dev&lt;br /&gt;
Menu preferences-&amp;gt;advanced-&amp;gt;certificates-&amp;gt;security devices-&amp;gt;load&lt;br /&gt;
 Module name: Belgium Identity Card PKCS#11&lt;br /&gt;
 Module filename: /usr/lib/libbeidpkcs11.so&lt;br /&gt;
&lt;br /&gt;
You can see your certificate in Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; View Certificates and you can trust the Belgium Root CA under the &amp;quot;Authorities&amp;quot; tab for e.g. &amp;quot;identifying mail users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Try to sign a first mail:&lt;br /&gt;
&amp;lt;br&amp;gt;Menu S-MIME -&amp;gt; Digitally sign this message -&amp;gt; setup certificate -&amp;gt; digital signing -&amp;gt; select your BELPIC auth certif&lt;br /&gt;
&lt;br /&gt;
I could successfully sign (with my PIN) and verify an email but only with the Authentication certificate, not the Signature certificate&lt;br /&gt;
&amp;lt;br&amp;gt;According to the snapshots of the official guide of the eID for Outlook, it&#039;s ok, the Authentication certificate must be used, the other being reserved for legal signatures.&lt;br /&gt;
&amp;lt;br&amp;gt;UPDATE: Well now that I saw that Wouter could sign with the signature certificate I tried again and indeed it works.&lt;br /&gt;
&lt;br /&gt;
One difficulty is that the certificate is not bound to an email address so the email client tells you sth like it&#039;s validly signed but no idea if the certificate owner corresponds to the sender email address.&lt;br /&gt;
&lt;br /&gt;
===Signing with pkcs15-crypt===&lt;br /&gt;
From https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/UsingOpenscTOC#using_opensc_smartcards_to_sign&lt;br /&gt;
&lt;br /&gt;
Signing text and extracting the public certificate:&lt;br /&gt;
 fortune &amp;gt; data.txt&lt;br /&gt;
 openssl sha1 -binary data.txt &amp;gt; data.sha1&lt;br /&gt;
 pkcs15-crypt --key 2 --sign --pkcs1 --sha-1 --input data.sha1 --output data.auth.sig&lt;br /&gt;
 pkcs15-tool --read-certificate 02 &amp;gt; my_auth.crt&lt;br /&gt;
&lt;br /&gt;
Verifying the signature:&lt;br /&gt;
 openssl x509 -in my_auth.crt -pubkey -noout &amp;gt; my_auth.pem&lt;br /&gt;
 openssl dgst -sha1 -verify my_auth.pem -signature data.auth.sig data.txt&lt;br /&gt;
&lt;br /&gt;
I tried to do the same with the signature certificate instead of the authentication certificate but I get an error:&lt;br /&gt;
 pkcs15-crypt --key 3 --sign --pkcs1 --sha-1 --input data.sha1 --output data.auth.sig&lt;br /&gt;
 [pkcs15-crypt] sec.c:67:sc_set_security_env: returning with: Not supported&lt;br /&gt;
 [pkcs15-crypt] pkcs15-sec.c:267:sc_pkcs15_compute_signature: sc_set_security_env() failed: Not supported&lt;br /&gt;
 Compute signature failed: Not supported&lt;br /&gt;
Indeed signing with the signature certificate and without a GUI showing a warning about the legal implication is forbidden.&lt;br /&gt;
&lt;br /&gt;
===Signing with GpgSM===&lt;br /&gt;
GpgSM is to X.509 what GnuPG is to OpenPGP, cf http://gnupg.org/aegypten/tech.en.html&lt;br /&gt;
&lt;br /&gt;
 apt-get install gpgsm dirmngr gnupg-agent pinentry-qt&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/gpg-agent.conf:&lt;br /&gt;
 no-grab&lt;br /&gt;
 default-cache-ttl 1800&lt;br /&gt;
 ignore-cache-for-signing&lt;br /&gt;
 allow-mark-trusted&lt;br /&gt;
&lt;br /&gt;
 ~/.bash_profile: (appending this stuff)&lt;br /&gt;
 # preparing gpg-agent:&lt;br /&gt;
 if test -f $HOME/.gpg-agent-info &amp;amp;&amp;amp; kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2&amp;gt;/dev/null; then&lt;br /&gt;
   GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info`&lt;br /&gt;
   export GPG_AGENT_INFO&lt;br /&gt;
 else&lt;br /&gt;
   eval `gpg-agent --daemon`&lt;br /&gt;
   echo $GPG_AGENT_INFO &amp;gt;$HOME/.gpg-agent-info&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/scdaemon.conf: (we disable internal CCID support as only libccid supports more or less my crappy reader)&lt;br /&gt;
 disable-ccid&lt;br /&gt;
 debug-level none&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/gpgsm.conf:&lt;br /&gt;
 debug-level none&lt;br /&gt;
&lt;br /&gt;
Acquiring the certificates:&lt;br /&gt;
 $ gpgsm --learn-card&lt;br /&gt;
Actually I had to run it several times, the first time only the Belgium CA was extracted, then the Citizen CA and finally the 2 personal certificates. And the behavior is not really reproductible so you&#039;ve to run it till you&#039;ve the 4 certificates:&lt;br /&gt;
 $ gpgsm --list-keys&lt;br /&gt;
 /home/phil/.gnupg/pubring.kbx&lt;br /&gt;
 -----------------------------&lt;br /&gt;
      Subject: /CN=Belgium Root CA/C=BE&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Citizen CA/C=BE/SerialNumber=200507&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Philippe Teuwen (Authentication)/C=BE/SerialNumber=...&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Philippe Teuwen (Signature)/C=BE/SerialNumber=...&lt;br /&gt;
To sign sth:&lt;br /&gt;
 $ gpgsm --sign mail.txt&lt;br /&gt;
Then I get prompted to trust Belgium CA and gpgsm fails &amp;quot;error creating signature: Certificat révoqué &amp;lt;GpgSM&amp;gt;&amp;quot;, normal.&lt;br /&gt;
&amp;lt;br&amp;gt;During trusting the Belgium CA, it created automatically a .gnupg/trustlist.txt with&lt;br /&gt;
 # CN=Belgium Root CA,C=BE&lt;br /&gt;
 DF:DF:AC:89:47:BD:F7:52:64:A9:23:3A:C1:0E:E3:D1:28:33:DA:CC S&lt;br /&gt;
&lt;br /&gt;
Ok let&#039;s try again without the CRLs check:&lt;br /&gt;
 $ gpgsm --disable-crl-checks --armor --sign --output mail.txt.smime mail.txt&lt;br /&gt;
 [...]&lt;br /&gt;
 gpgsm: signature created&lt;br /&gt;
I was prompted for my PIN during the process.&lt;br /&gt;
&lt;br /&gt;
And trying to verify, with CRLs:&lt;br /&gt;
 $ gpgsm --verify --output mail.txt mail.txt.smime&lt;br /&gt;
 gpgsm: Signature made 2008-02-06 21:42:40 using certificate ID 0x80211056&lt;br /&gt;
 gpgsm: note: non-critical certificate policy not allowed&lt;br /&gt;
 dirmngr[8994]: error opening `/home/phil/.gnupg/dirmngr_ldapservers.conf&#039;: Aucun fichier ou répertoire de ce type&lt;br /&gt;
 dirmngr[8994]: permanently loaded certificates: 0&lt;br /&gt;
 dirmngr[8994]:     runtime cached certificates: 0&lt;br /&gt;
 dirmngr[8994]: command ISVALID failed: Certificat révoqué&lt;br /&gt;
 gpgsm: certificate #100000000000E144CBC42E9BB2453EE4/2.5.4.5=#323030353037,CN=Citizen CA,C=BE&lt;br /&gt;
 gpgsm: certificate has been revoked&lt;br /&gt;
 gpgsm: invalid certification chain: Certificat révoqué&lt;br /&gt;
And without CRLs:&lt;br /&gt;
 $ gpgsm --disable-crl-checks --verify --output mail.txt mail.txt.smime          &lt;br /&gt;
 gpgsm: Signature made 2008-02-06 21:42:40 using certificate ID 0x80211056&lt;br /&gt;
 gpgsm: CRLs not checked due to --disable-crl-checks option&lt;br /&gt;
 gpgsm: Good signature from &amp;quot;/CN=Philippe Teuwen (Authentication)/C=BE/SerialNumber=...&lt;br /&gt;
&lt;br /&gt;
===e-Signing plugin for Firefox===&lt;br /&gt;
* pure curiosity...&lt;br /&gt;
* cf http://www.certipost.be/dpsolutions/en/e-signing-faq.html&lt;br /&gt;
* the plugin is signed so you&#039;ve to install the CA certificate of Certipost first and, cf above in my &amp;quot;funny facts&amp;quot;, for Firefox, you&#039;ve to download and... trust it.&amp;lt;br&amp;gt;The certificate is apparently no longer (broken link) and I could not find it in their search tool, the only thing I could find is [http://64.233.183.104/search?q=cache:vzHK3UKTuiMJ:www.certipost.be/en/certificates/PrimaryNormalisedCA/certificate_pem.cer+PrimaryNormalisedCA&amp;amp;hl=fr&amp;amp;ct=clnk&amp;amp;cd=3&amp;amp;gl=fr a copy of the pem version in Google cache(!)]&amp;lt;br&amp;gt;but that was good enough to be able to install the plugin.&lt;br /&gt;
* Moreover [https://connect.e-signing.be/app/en/create the form to sign] wants to directly execute some jar file but under an SSL connection signed by... the so-hard-to-get Certipost CA certificate, itself signed by GTE CyberTrust Global Root, an authority built-in in the browsers.&lt;br /&gt;
* You&#039;ve [https://www.certipost.be/webshop/ to pay] to be able to sign with your eID non-repudiation signature to have a valid &#039;&#039;Qualified Electronic Signature with long term value&#039;&#039;&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/images/stories/e-signing/right/technical_measures_en.pdf There are some explanations] of the additional services provided by CertiPost:&amp;lt;br&amp;gt;&#039;&#039;The applied XAdES-X-L is an XML signature format according to the recognized XAdES standard (ETSI TS 101 903 standard) that implements measures to satisfy the legal requirements for advanced electronic signatures as defined in the European Directive (EC 1999/93: European Community (EC) DIRECTIVE 1999/93/EC OF THE EUROPEAN PARLIAMENT AND COUNCIL ON A COMMUNITY FRAMEWORK FOR ELECTRONIC SIGNATURES) and for long term non-repudiation. Next to the electronic signature itself, the XAdES-X-Lfile contains the certificate that was used during the signature, the information to proof whether the certificate was valid when signing, and a time stamp to proof that all information used for signing existed and not altered since.&amp;lt;br&amp;gt;Moreover CertiPost keeps a copy of the signed information.&lt;br /&gt;
* Timestamps &amp;amp; storage look like additional features, not mandated by the law, so can I create a &#039;&#039;Qualified Electronic Signature with long term value&#039;&#039; out of the CertiPost context, so just a plain x509 signature?&lt;br /&gt;
&lt;br /&gt;
===SSH===&lt;br /&gt;
Inspired from http://simi.be/?page_id=9&lt;br /&gt;
&lt;br /&gt;
Getting the patch from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=355274 and porting it to v4.7p1&lt;br /&gt;
&amp;lt;br&amp;gt;Some rejs easy to solve from v4.2 to v4.7 and one less obvious change in debian/control: fix the debconf dependancies (was ${debconf:Depends} I think):&lt;br /&gt;
 Package: openssh-client-sc                                                          &lt;br /&gt;
 Architecture: any                                                                   &lt;br /&gt;
 Depends: ${shlibs:Depends}, debconf (&amp;gt;= 1.2.0) | debconf-2.0,...&lt;br /&gt;
&amp;lt;br&amp;gt;I recompile ssh with smartcard support.&lt;br /&gt;
 apt-get source openssh-client&lt;br /&gt;
 cd openssh-4.7p1&lt;br /&gt;
 patch -p1 &amp;lt; ../mypatch&lt;br /&gt;
 dpkg-buildpackage -uc -us -rfakeroot&lt;br /&gt;
Sending my public key to the ssh server:&lt;br /&gt;
 pkcs15-tool --read-ssh-key 2 |tail -n1|ssh user@host &#039;cat - &amp;gt;&amp;gt; ~/.ssh/authorized_keys&#039;&lt;br /&gt;
Then logging, being prompted for my PIN:&lt;br /&gt;
 ssh -I 0 user@host.com&lt;br /&gt;
===OpenID===&lt;br /&gt;
cf [[OpenID]] and [[OpenID-eID]] where I&#039;m hacking phpMyID to make my own&lt;br /&gt;
&lt;br /&gt;
===TODO: Login===&lt;br /&gt;
I tried https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/UsingOpenscTOC#logging_in_with_smartcards&lt;br /&gt;
but with the eID.&lt;br /&gt;
 apt-get install libpam-p11&lt;br /&gt;
See file:///usr/share/doc/libpam-p11/QuickStart.html&lt;br /&gt;
&amp;lt;br&amp;gt;Bad side: it conflicts with xlockmore :-(&lt;br /&gt;
&lt;br /&gt;
openssh way:&lt;br /&gt;
&amp;lt;br&amp;gt;Preparing the account with .ssh/authorized_keys, cf SSH auth on this page&lt;br /&gt;
&amp;lt;br&amp;gt;Edit /etc/pam.d/login and add before &amp;quot;@include common-auth&amp;quot; sth like:&lt;br /&gt;
 auth sufficient pam_p11_openssh.so /usr/lib/opensc-pkcs11.so&lt;br /&gt;
/var/log/auth.log tells: no certificates found&lt;br /&gt;
or&lt;br /&gt;
 auth sufficient pam_p11_openssh.so /usr/lib/libbeidpkcs11.so&lt;br /&gt;
/var/log/auth.log tells: fatal: pkcs11_sign failed &lt;br /&gt;
&amp;lt;br&amp;gt;before I was even prompted for my PIN&lt;br /&gt;
&lt;br /&gt;
opensc way: same results&lt;br /&gt;
 auth sufficient pam_p11_opensc.so /usr/lib/opensc-pkcs11.so&lt;br /&gt;
 auth sufficient pam_p11_opensc.so /usr/lib/libbeidpkcs11.so&lt;br /&gt;
preparing the account:&lt;br /&gt;
 mkdir ~/.eid&lt;br /&gt;
 chmod 0755 ~/.eid&lt;br /&gt;
 pkcs15-tool -r 2 &amp;gt; ~/.eid/authorized_certificates&lt;br /&gt;
 chmod 0644 ~/.eid/authorized_certificates&lt;br /&gt;
&lt;br /&gt;
So I still couldn&#039;t find a way.&lt;br /&gt;
&lt;br /&gt;
===TODO: SSL Auth===&lt;br /&gt;
http://blog.eikke.com/index.php/ikke/2007/10/29/using_your_belgian_eid_for_ssl_authentic&lt;br /&gt;
&lt;br /&gt;
 apt-get install libengine-pkcs11-openssl&lt;br /&gt;
&lt;br /&gt;
To generate a request, open a console and launch openssl. Once at the OpenSSL prompt, issue these 2 commands:&lt;br /&gt;
 engine -t dynamic -pre SO_PATH:/usr/lib/engines/engine_pkcs11.so -pre ID:pkcs11 -pre LIST_ADD:1 -pre LOAD -pre MODULE_PATH:/usr/lib/opensc-pkcs11.so&lt;br /&gt;
Adjust paths if necessary, of course. This loads the pkcs11 engine inside OpenSSL.&lt;br /&gt;
 req -engine pkcs11 -new -days 100 -key id_02 -keyform engine -out myrequest.csr -subj &amp;quot;/C=BE/ST=O-VL/O=My Organisation/CN=My Name/emailAddress=my@email.tld&amp;quot;&lt;br /&gt;
Adjust the days, out and subj parameters, at least. The key ID can be found using&lt;br /&gt;
 pkcs15-tool -c&lt;br /&gt;
Use the ID of the Authentication X509 certificate.&lt;br /&gt;
&lt;br /&gt;
===TODO: Apache SSL Reverse Proxy===&lt;br /&gt;
cf http://www.belgium.be/zip/eid_authentication_proxy_fr.html&lt;br /&gt;
===TODO: OpenGPG &amp;amp; x509===&lt;br /&gt;
Old dream is to sign an OpenPGP key with the eID, but even if technically possible, it probably breaks the validation chain as what Citizen CA signed was the entire certificate, not just the key/uid.&lt;br /&gt;
&amp;lt;br&amp;gt;Sth to check: [http://www.imc.org/ietf-openpgp/mail-archive/msg09930.html OpenPGP Signatures Incorporating X.509 Certificates]&lt;br /&gt;
&amp;lt;br&amp;gt;The solution is apparently to extend OpenGPG to allow special signatures on UIDs with sub-packets containing the entire certificate, the UID being build from the DN fields of the certificate (CN, EMAIL,...)&lt;br /&gt;
&amp;lt;br&amp;gt;Apparently PGP supports it already?&lt;br /&gt;
&lt;br /&gt;
===TODO: OpenVPN Auth===&lt;br /&gt;
http://christophe.vandeplas.com/2008/02/03/openvpn-belgian-eid&lt;br /&gt;
&amp;lt;br&amp;gt;But Debian openvpn 2.1_cr4 doesn&#039;t support yet --show-pkcs11-ids&lt;br /&gt;
===TODO: Other tools===&lt;br /&gt;
* [http://sourceforge.net/projects/opensignature OpenSignature] for Italia&lt;br /&gt;
* [http://openportalguard.sourceforge.net/ Open Portal Guard] for e.g. public administrations&lt;/div&gt;</summary>
		<author><name>212.71.5.64</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=2938</id>
		<title>Belgian eID</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=2938"/>
		<updated>2008-03-04T23:20:01Z</updated>

		<summary type="html">&lt;p&gt;212.71.5.64: /* Exploring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Belgian eID is part of the efforts of the government for [[Belgian eGov]]&lt;br /&gt;
==Officials==&lt;br /&gt;
&lt;br /&gt;
* [http://eid.belgium.be Official eID portal]&lt;br /&gt;
* [http://repository.eid.belgium.be/FR/Index.htm Certificates]&lt;br /&gt;
* [http://status.eid.belgium.be/ eID services]&lt;br /&gt;
* [http://crl.eid.belgium.be/ Revocation lists] and [http://ocsp.eid.belgium.be/ OCSP server]&lt;br /&gt;
* [http://eid.belgium.be/fr/navigation/documents/37129.html Circulaires (fr) eID Home  /  Villes et communes  /  Quoi  /  Circulaires]&amp;lt;br&amp;gt;Among others:&amp;lt;br&amp;gt; 3) FORMULAIRE DE RENONCIATION AUX CERTIFICATS DE LA CARTE D’IDENTITE ELECTRONIQUE AU MOMENT DE LA DEMANDE DE LA CARTE&amp;lt;br&amp;gt;10) MODELE D’ATTESTATION D’ACTIVATION OU DE REVOCATION DES CERTIFICATS APRES ACTIVATION DE LA CARTE&amp;lt;br&amp;gt;11) MODELE D’ATTESTATION DE SUSPENSION ET DE REACTIVATION DES CERTIFICATS&lt;br /&gt;
* [http://www.certipost.be CertiPost], by Belgacom &amp;amp; La Poste/De Post&lt;br /&gt;
** [http://www.certipost.be/x500/X500.html Certipost E-Trust™ Public X500 Directory Search]&lt;br /&gt;
&lt;br /&gt;
==Usage &amp;amp; Software==&lt;br /&gt;
&lt;br /&gt;
* [http://www.belgium.be/zip/eid_datacapture_fr.html Middleware &amp;amp; developer&#039;s kit]&lt;br /&gt;
** There are also Debian packages, cf below my tests under Linux&lt;br /&gt;
** [http://developer.novell.com/wiki/index.php/EID-belgium eID configuration toolkit by Novell]&lt;br /&gt;
* [http://homes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/WebHome Danny De Cock&#039;s page on eID] (same as http://www.godot.be)&lt;br /&gt;
* [http://weblogs.asp.net/cumpsd/archive/2005/04/03/396900.aspx short intro]&lt;br /&gt;
* [http://weblogs.asp.net/cumpsd/archive/2005/04/03/396901.aspx how to use the eID card within your .NET apps]&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
* http://www.foo.be/eID/ Official data, spec sheet etc (outdated)&lt;br /&gt;
* [http://belsec.skynetblogs.be/tag/1/E-ID Belsec blog entries] about the eID&lt;br /&gt;
* [http://www.uvcw.be/no_index/e-communes/dossier_eid/Belgian_eID_Run-time_Users_guide.pdf Belgian E-ID runtime guide windows/linux pdf]&lt;br /&gt;
* [http://www.porvoo8.rrn.fgov.be/porvoo8/doc13/09_porvoo8-bruegger18_Italy.pdf Open source interoperability and E-ID pdf]&lt;br /&gt;
* [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/5%20aspects%20techniques/fr/belpic_eid_version_numbering_v1.5.2.pdf The versioning of E-ID pdf]&lt;br /&gt;
* [http://porvoo10.net/p10/10_porvoo10-bud-25.pdf The road to European E-ID interoperability pdf]&lt;br /&gt;
* [http://www.microsoft.com/belux/nl/eid/ Microsoft and the eID], just an old marketing buzz? (I wouldn&#039;t complain...)&lt;br /&gt;
* [http://samba.grep.be/~wouter/beid-screencast.ogg], BeID screencast of what should have been shown at Fosdem 2008, by Wouter. (still waiting for the video of the presentation...)&lt;br /&gt;
* [http://www.lalibre.be/societe/cyber/article/404626/la-carte-d-identite-electronique-permettra-de-s-enregistrer-sur-ebay.html] La carte d&#039;identité électronique permettra de s&#039;enregistrer sur eBay&lt;br /&gt;
&lt;br /&gt;
==I revoked my certificates==&lt;br /&gt;
===Why?===&lt;br /&gt;
Because at that time I knew too few on the details of the eID architecture and too much about how a new security architecture can have flaws, so better to stay away for a while, especially given the legal implications that the eID can bring.&amp;lt;br&amp;gt;I knew they were talking about two certificates without understanding their difference, so let&#039;s revoke both.&amp;lt;br&amp;gt;Note that it doesn&#039;t mean my eID is not valid, eID card activation is mandatory. The eID card is a proof of identity and residence of a person in Belgium. eID certificates activation is a choice of the holder of the eID (opt-in), he/she can decide to activate or revoke the certificates. (cf [http://www.certipost.be/dpsolutions/en/eid-faq.html FAQ])&lt;br /&gt;
===How?===&lt;br /&gt;
It was quite epic.&lt;br /&gt;
&amp;lt;br&amp;gt;I was still a bit prepared, hopefully, so I had printed the Annexes 3 &amp;amp; 10, the legal forms to ask either to renounce to have the certificates or to revoke them just after activation, as well as the relevant parts of the User Manual for the civil servants :-)&lt;br /&gt;
&amp;lt;br&amp;gt;I printed both as for me it was not clear from the User Manual how to renounce for the certificates.&lt;br /&gt;
* [Me] Good morning, I come for my eID and... I want to get rid of the certificates&lt;br /&gt;
* [Her] You what? Is it possible? Never heard about that&lt;br /&gt;
* [Me] Yes, yes, see (and I show her what&#039;s in her User Manual)&lt;br /&gt;
* ... (takes a while to digest the info)&lt;br /&gt;
* [Her] Ha ok, you&#039;ve to fill Annex 3, (shouting behind her shoulder) JOSETTE, DO WE HAVE ANNEX 3???&lt;br /&gt;
* [Josette] ANNEX WHAT??&lt;br /&gt;
* [Me] No prob, look (and I pull out my own copy of [http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/03_-_FORMULAIRE_RENONCIATION_CERTIFS.pdf Annex 3 (pdf)])&lt;br /&gt;
* ... (meanwhile she has no idea what to do on the eID to fulfill renouncement and I agree with her, the Manual was unclear so we went for activation+revocation)&lt;br /&gt;
* [Me] No prob, look (and I pull out my own copy of [http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/10_-_Attestation_activ_Certificats(18-10)_27-07.pdf Annex 10 (pdf)])&lt;br /&gt;
* [Her] Can I take your copies before you fill them? I&#039;ll make copies for ourselves.&lt;br /&gt;
So today the official Annex 3&amp;amp;10 forms of this civil office are mine :-D&amp;lt;br&amp;gt;Who knows, maybe I crafted the form... ;-)&lt;br /&gt;
&lt;br /&gt;
It is &amp;quot;funny&amp;quot; to see that everywhere the activation of the certificates is presented as optional, the choice being left to the citizen, blablabla, but in reality most of the citizen just don&#039;t know about this possibility (and most of the civil servants, well I hope that since my story, things have evolved a bit) and the civil servants doesn&#039;t ask you the question.&lt;br /&gt;
&lt;br /&gt;
===Some details about those certificates===&lt;br /&gt;
The eID contains 2 signature certificates, so you cannot encrypt with them, just sign.&lt;br /&gt;
* One labeled &amp;quot;Authentication&amp;quot; is for daily use &lt;br /&gt;
** To log in on SSL websites such as [http://minfin.fgov.be/taxonweb/ Tax-on-web] or [http://www.saferchat.be SaferChat] or even your bank e.g. [http://www.keytradebank.com/pdf/eID_en.pdf Keytrade has implemented it (pdf)] with CRL check&lt;br /&gt;
** For signing mails with S/MIME&lt;br /&gt;
** For your own purpose, to log on your SSH server, SSL server, VPN etc&lt;br /&gt;
* One labeled &amp;quot;Signature&amp;quot; is for special cases&lt;br /&gt;
** It has a equivalent legal value as a hand-written signature and is referred as non-repudiation signature.&lt;br /&gt;
** According to [http://www.certipost.be/dpsolutions/images/stories/e-signing/right/applicability_en.pdf CertiPost applicability guidelines (pdf)], the electronic signature still cannot replace a hand-written signature in a number of cases&lt;br /&gt;
**It&#039;s automatically revoked for minors under 18 years as they cannot sign legally yet.&lt;br /&gt;
**From [http://www.certipost.be/dpsolutions/en/eid-faq.html Certipost FAQ]:&amp;lt;br&amp;gt;&#039;&#039;Non-repudiation guarantees that one cannot deny having performed an act. E.g. any message signed using a person&#039;s digital signature can only have come from this person. The signing person can not claim that the message was not originated by him.&amp;lt;br&amp;gt;In other words, non-repudiation means that information &#039;&#039;&#039;cannot be disclaimed&#039;&#039;&#039;, similar to a &#039;&#039;&#039;witnessed&#039;&#039;&#039; handwritten signature on a paper document.&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;to be checked in the law&#039;&#039;&lt;br /&gt;
** Normal pkcs software doesn&#039;t seem to be able to use it (?)&lt;br /&gt;
** Should be used only through the Government software which prompts you with a special GUI and warnings about the legal power of this signature&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/en/rem-overzicht.html CertiPost e-Registered mails] is using the non-repudiation signature&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/en/e-signing-overview.html CertiPost e-Signing] is using the non-repudiation signature&lt;br /&gt;
* Both are protected by the same PIN which is typed on your (unsafe) PC&lt;br /&gt;
&lt;br /&gt;
===What says the law===&lt;br /&gt;
Sorry, here are french version abstracts.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;9 JUILLET 2001. - Loi fixant certaines règles relatives au cadre juridique pour les signatures électroniques et les services de certification&#039;&#039;&#039;, date de publication au Moniteur: 29 septembre 2001&lt;br /&gt;
&amp;lt;br&amp;gt;Morceaux choisis:&lt;br /&gt;
* Art. 4. § 1er. A défaut de dispositions légales contraires, nul ne peut être contraint de poser un acte juridique par voie électronique.&lt;br /&gt;
* § 4. Sans préjudice des articles 1323 et suivants du Code civil, une signature électronique avancée réalisée sur la base d&#039;un certificat qualifié et conçue au moyen d&#039;un dispositif sécurisé de création de signature électronique, est assimilée à une signature manuscrite, qu&#039;elle soit réalisée par une personne physique ou morale.&lt;br /&gt;
* § 5. Une signature électronique ne peut être privée de son efficacité juridique et ne peut être refusée comme preuve en justice au seul motif :&lt;br /&gt;
** que la signature se présente sous forme électronique, ou&lt;br /&gt;
** qu&#039;elle ne repose pas sur un certificat qualifié, ou&lt;br /&gt;
** qu&#039;elle ne repose pas sur un certificat qualifié délivré par un prestataire accrédité de service de certification, ou&lt;br /&gt;
** qu&#039;elle n&#039;est pas créée par un dispositif sécurisé de création de signature.&lt;br /&gt;
* &#039;&#039;Wait a minute, ANY electronic signature NOT being based on a qualified certificate and NOT created in a secure environment CANNOT be refused as a legal proof???&amp;lt;br&amp;gt;Maybe it&#039;s me or the triple-negation sentences (lawyers, lawyers...) but it looks like § 5 goes much further than § 4&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===What do I think today?===&lt;br /&gt;
====Catastrophe scenario==== &lt;br /&gt;
* Someone captures your PIN while you&#039;re using it for &amp;quot;just authentication&amp;quot; via e.g. malware, virus, trojan, worm on the PC &lt;br /&gt;
** you know, the kind of stuff that never happens, anyway it&#039;s now [http://eid.belgium.be/fr/navigation/documents/39814.html your problem] even if the official middleware [http://blog.didierstevens.com/2007/12/31/how-can-i-trust-the-beid-runtime/ is not signed]&lt;br /&gt;
**And apparently even some readers with integrated keypads are [http://belsec.skynetblogs.be/post/5426553/belgian-eid-nr-11--keyloggers-work-with-eid not safer :-(]&lt;br /&gt;
**And apparently even commercial standalone smatcard terminals are [http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-711.pdf not safer :-( (pdf)]&lt;br /&gt;
**And, oh, I did a small test with [[Keyloggers|lkl, a userland keylogger]] and of course the PIN typed into the beid graphical prompt could be easily captured.&lt;br /&gt;
* He gets physical access to your eID, even briefly if he has e.g. a PDA with Internet &amp;amp; smartcard reader.&lt;br /&gt;
* Now he can sign with your legal signature anything you can imagine... and you cannot repudiate what he does.&lt;br /&gt;
* The fact that maybe legal signatures have to be crafted through CertiPost (cf e-signing below) doesn&#039;t change anything to this risk.&lt;br /&gt;
&lt;br /&gt;
====So what will I do next time?====&lt;br /&gt;
* I&#039;ll probably accept the Authentication certificate to be able to play around with it.&lt;br /&gt;
* For sure I&#039;ll revoke the Signature certificate unless they change their architecture.&lt;br /&gt;
** Not the same PIN than the other certificate.&lt;br /&gt;
** Better than 4 digits (&amp;amp; 3 attempts so 3 chances over 10000)&lt;br /&gt;
** Probably they limited themselves to one single small PIN in order to pass the [http://www.kafka.be Kafka test] ;-)&lt;br /&gt;
** Even then:&lt;br /&gt;
*** Then I could use it but only on trusted devices, that&#039;s another story...&lt;br /&gt;
*** You get the PIN &amp;amp; PUK by post if I remember well, this could be eavesdropped but you can change your PIN... So  as the PUK can unlock the PIN 12 times, the attacker has 36 chances over 10000, one over 278, mmm... And who said humans can generate random PINs? ;-)&lt;br /&gt;
&lt;br /&gt;
===Privacy and other security considerations===&lt;br /&gt;
* [http://idcorner.org/2005/07/04/the-belgian-eid-card-calamity/ Another] [http://www.idcorner.org/?p=121 consideration] I didn&#039;t talk about yet: PRIVACY&lt;br /&gt;
* Whoever sees your public certificate (which happens e.g. if you log to a SSL website with your card or &#039;&#039;&#039;if you simply send a signed email&#039;&#039;&#039;) sees your [http://www.ibz.rrn.fgov.be/ RRN (&amp;quot;rijksregistratienummer&amp;quot;)]&amp;lt;br&amp;gt;BTW here is [http://fr.wikipedia.org/wiki/Num%C3%A9ro_de_registre_national how it&#039;s constructed]: It is a total of 11 numbers of which the first 6 are your birthdate JJMMDD followed by three numbers to distinguish the people that were born on the same day (even for men, uneven for women) and the last two numbers are a control number. So if you know the birthdate and the sex of the person, and you know how the control sum is done (97-JJMMDDXXX%97), you only miss two and a half numbers coming from a linear incremental counter (001, 003,...) to recompile his national register number. For mine it takes less than 40 attempts it you proceed logically...&lt;br /&gt;
* [http://minfin.fgov.be/taxonweb/ Tax-on-web] announce it but what about the others and your mail correspondants?&amp;lt;br&amp;gt;&#039;&#039;Suite à l&#039;utilisation de votre moyen d&#039;authentification (carte d&#039;identité électronique ou token citoyen), le SPF Finances a connaissance de votre numéro de registre national.&amp;lt;br&amp;gt;Conformément à l&#039;arrêté royal du 25/04/1986 autorisant certaines autorités du Ministère des Finances à utiliser le numéro d&#039;identification du registre national des personnes physiques, votre numéro de registre national n&#039;est utilisé dans ce contexte qu&#039;à des fins d&#039;identification pour l&#039;accès aux applications du SPF Finances.&amp;lt;br&amp;gt;La loi du 8 décembre 1992 relative à la protection de la vie privée à l&#039;égard des traitements de données à caractère personnel s&#039;applique à ce traitement d&#039;identification dont le responsable est le SPF Finances, Boulevard Albert II, 33 à 1030 Bruxelles.&#039;&#039;&lt;br /&gt;
* Other &amp;quot;funny&amp;quot; facts: Belgium government doesn&#039;t bother about cross-certification with any common Root CA so when you want to visit an official site supposedly secured such as  https://ccff02.minfin.fgov.be/CCFF_Authentication/choseLoginMethod.do or https://mijndossier.rrn.fgov.be you&#039;re kindly asked to blindly trust the certificate, years after phishing was invented, sigh...&lt;br /&gt;
* And even &amp;quot;better&amp;quot;: for Firefox, [http://www.certipost.be/dpsolutions/en/e-signing-faq.html CertiPost e-Signing] requires you to download and install their CA certificate and to trust it for identifying everything: web sites, mail users and software! Here the download of the CA certificate is done... on pure http, sigh...&lt;br /&gt;
* [https://www.cosic.esat.kuleuven.be/adapid/ ADAPID project] is a consortium of researchers and industry representatives in Flanders decided to take action in an attempt to help avoid a national privacy calamity. After a first (non-public) report, the ADAPID project won the financial support of IWT-Flanders. ADAPID officially started July 1st, 2005 and will run until June 30th, 2009.&lt;br /&gt;
* Normally the third and definitive version of the eID should have been rolled out begin of this year (2008) but I&#039;ve no idea what are the changes.&lt;br /&gt;
* [http://www.cirb.irisnet.be/site/fr/eid/ethicalid/index_htm Ethical-ID] is a software which presents to the e.g. swimming pool employee the only relevant data e.g. the residence city.&lt;br /&gt;
&lt;br /&gt;
==My attempts under Linux==&lt;br /&gt;
I&#039;m using the [[IDream ID-SMID01 SmartCard reader]], bought for 10€&lt;br /&gt;
&lt;br /&gt;
Installing beidgui and dependencies:&lt;br /&gt;
 apt-get install beidgui beid-tools&lt;br /&gt;
 =&amp;gt; libopenct1 libpcsclite1 libbeidlibopensc2 libbeid2 beid-tools beidgui libccid pcscd &lt;br /&gt;
 less /usr/share/doc/libbeidlibopensc2/README.Debian&lt;br /&gt;
&lt;br /&gt;
The GUI application works well, including OCSP communication, showing me that my eID certificates are revoked, excellent!&lt;br /&gt;
&lt;br /&gt;
UPDATE: There is a version 2.6.0-3 available in unstable&lt;br /&gt;
 apt-get install -t unstable beidgui beid-tools&lt;br /&gt;
&lt;br /&gt;
There are 2 daemons provided with beid-tools:&lt;br /&gt;
* beidcrld&amp;lt;br&amp;gt;Automatic CRL download&lt;br /&gt;
* beidpcscd&amp;lt;br&amp;gt;The privacy filter monitors all commands sent to the card. When an application requests to read the identity data, address or photo from the eID card, the filter will display a message and ask the user&#039;s consent&lt;br /&gt;
&lt;br /&gt;
===Exploring===&lt;br /&gt;
 pkcs15-tool --dump&lt;br /&gt;
 pkcs15-tool --read-certificate 02 &amp;gt; my_auth.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 03 &amp;gt; my_sign.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 04 &amp;gt; belgium.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 06 &amp;gt;&amp;gt; belgium.crt&lt;br /&gt;
 openssl x509 -in my_auth.crt -text&lt;br /&gt;
 pkcs15-tool --read-ssh-key 2&lt;br /&gt;
 # For a little demo...&lt;br /&gt;
 beid-pkcs11-tool --slot 0 --login --test&lt;br /&gt;
There are 2 daemons but their usage is still unclear to me as everythingn works (or not) with or without those daemons.&lt;br /&gt;
* beidcrld, about keeping CRLs up-to-date?&lt;br /&gt;
* beidpcscd, ?, it&#039;s listening on port tcp 2500 and beidcrld, firefox-bin and icedove-bin are constantly speaking with it...&lt;br /&gt;
There is also some java support but I couldn&#039;t try it yet.&lt;br /&gt;
&lt;br /&gt;
===Firefox security module===&lt;br /&gt;
To add the security module to Firefox:&lt;br /&gt;
 apt-get install libbeid2-dev libbeidlibopensc2-dev&lt;br /&gt;
Visit file:///usr/share/beid/beid-pkcs11-register.html to install the service&lt;br /&gt;
&lt;br /&gt;
Now what?...&lt;br /&gt;
&amp;lt;br&amp;gt;cf http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/eID-FR-Firefox.pdf&lt;br /&gt;
&amp;lt;br&amp;gt;You can see your certificate in Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; View Certificates and you can trust the Belgium Root CA under the &amp;quot;Authorities&amp;quot; tab for e.g. &amp;quot;identifying mail users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can then connect to federal sites like [http://minfin.fgov.be/taxonweb/ Tax-on-web] or the [https://mondossier.rrn.fgov.be RRN], being identified by your card &amp;amp; PIN.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that it works only if I start Firefox after having the eID in place in the reader.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that I didn&#039;t get much further, being redirected to e.g.&lt;br /&gt;
this nonexistent page but the title speaks for itself ;-) https://mondossier.rrn.fgov.be/CertificateRevoked.html&lt;br /&gt;
&lt;br /&gt;
===Thunderbird security module===&lt;br /&gt;
To add the security module to Firefox:&lt;br /&gt;
 apt-get install libbeid2-dev libbeidlibopensc2-dev&lt;br /&gt;
Menu preferences-&amp;gt;advanced-&amp;gt;certificates-&amp;gt;security devices-&amp;gt;load&lt;br /&gt;
 Module name: Belgium Identity Card PKCS#11&lt;br /&gt;
 Module filename: /usr/lib/libbeidpkcs11.so&lt;br /&gt;
&lt;br /&gt;
You can see your certificate in Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; View Certificates and you can trust the Belgium Root CA under the &amp;quot;Authorities&amp;quot; tab for e.g. &amp;quot;identifying mail users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Try to sign a first mail:&lt;br /&gt;
&amp;lt;br&amp;gt;Menu S-MIME -&amp;gt; Digitally sign this message -&amp;gt; setup certificate -&amp;gt; digital signing -&amp;gt; select your BELPIC auth certif&lt;br /&gt;
&lt;br /&gt;
I could successfully sign (with my PIN) and verify an email but only with the Authentication certificate, not the Signature certificate&lt;br /&gt;
&amp;lt;br&amp;gt;According to the snapshots of the official guide of the eID for Outlook, it&#039;s ok, the Authentication certificate must be used, the other being reserved for legal signatures.&lt;br /&gt;
&amp;lt;br&amp;gt;UPDATE: Well now that I saw that Wouter could sign with the signature certificate I tried again and indeed it works.&lt;br /&gt;
&lt;br /&gt;
One difficulty is that the certificate is not bound to an email address so the email client tells you sth like it&#039;s validly signed but no idea if the certificate owner corresponds to the sender email address.&lt;br /&gt;
&lt;br /&gt;
===Signing with pkcs15-crypt===&lt;br /&gt;
From https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/UsingOpenscTOC#using_opensc_smartcards_to_sign&lt;br /&gt;
&lt;br /&gt;
Signing text and extracting the public certificate:&lt;br /&gt;
 fortune &amp;gt; data.txt&lt;br /&gt;
 openssl sha1 -binary data.txt &amp;gt; data.sha1&lt;br /&gt;
 pkcs15-crypt --key 2 --sign --pkcs1 --sha-1 --input data.sha1 --output data.auth.sig&lt;br /&gt;
 pkcs15-tool --read-certificate 02 &amp;gt; my_auth.crt&lt;br /&gt;
&lt;br /&gt;
Verifying the signature:&lt;br /&gt;
 openssl x509 -in my_auth.crt -pubkey -noout &amp;gt; my_auth.pem&lt;br /&gt;
 openssl dgst -sha1 -verify my_auth.pem -signature data.auth.sig data.txt&lt;br /&gt;
&lt;br /&gt;
I tried to do the same with the signature certificate instead of the authentication certificate but I get an error:&lt;br /&gt;
 pkcs15-crypt --key 3 --sign --pkcs1 --sha-1 --input data.sha1 --output data.auth.sig&lt;br /&gt;
 [pkcs15-crypt] sec.c:67:sc_set_security_env: returning with: Not supported&lt;br /&gt;
 [pkcs15-crypt] pkcs15-sec.c:267:sc_pkcs15_compute_signature: sc_set_security_env() failed: Not supported&lt;br /&gt;
 Compute signature failed: Not supported&lt;br /&gt;
Indeed signing with the signature certificate and without a GUI showing a warning about the legal implication is forbidden.&lt;br /&gt;
&lt;br /&gt;
===Signing with GpgSM===&lt;br /&gt;
GpgSM is to X.509 what GnuPG is to OpenPGP, cf http://gnupg.org/aegypten/tech.en.html&lt;br /&gt;
&lt;br /&gt;
 apt-get install gpgsm dirmngr gnupg-agent pinentry-qt&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/gpg-agent.conf:&lt;br /&gt;
 no-grab&lt;br /&gt;
 default-cache-ttl 1800&lt;br /&gt;
 ignore-cache-for-signing&lt;br /&gt;
 allow-mark-trusted&lt;br /&gt;
&lt;br /&gt;
 ~/.bash_profile: (appending this stuff)&lt;br /&gt;
 # preparing gpg-agent:&lt;br /&gt;
 if test -f $HOME/.gpg-agent-info &amp;amp;&amp;amp; kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2&amp;gt;/dev/null; then&lt;br /&gt;
   GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info`&lt;br /&gt;
   export GPG_AGENT_INFO&lt;br /&gt;
 else&lt;br /&gt;
   eval `gpg-agent --daemon`&lt;br /&gt;
   echo $GPG_AGENT_INFO &amp;gt;$HOME/.gpg-agent-info&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/scdaemon.conf: (we disable internal CCID support as only libccid supports more or less my crappy reader)&lt;br /&gt;
 disable-ccid&lt;br /&gt;
 debug-level none&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/gpgsm.conf:&lt;br /&gt;
 debug-level none&lt;br /&gt;
&lt;br /&gt;
Acquiring the certificates:&lt;br /&gt;
 $ gpgsm --learn-card&lt;br /&gt;
Actually I had to run it several times, the first time only the Belgium CA was extracted, then the Citizen CA and finally the 2 personal certificates. And the behavior is not really reproductible so you&#039;ve to run it till you&#039;ve the 4 certificates:&lt;br /&gt;
 $ gpgsm --list-keys&lt;br /&gt;
 /home/phil/.gnupg/pubring.kbx&lt;br /&gt;
 -----------------------------&lt;br /&gt;
      Subject: /CN=Belgium Root CA/C=BE&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Citizen CA/C=BE/SerialNumber=200507&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Philippe Teuwen (Authentication)/C=BE/SerialNumber=...&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Philippe Teuwen (Signature)/C=BE/SerialNumber=...&lt;br /&gt;
To sign sth:&lt;br /&gt;
 $ gpgsm --sign mail.txt&lt;br /&gt;
Then I get prompted to trust Belgium CA and gpgsm fails &amp;quot;error creating signature: Certificat révoqué &amp;lt;GpgSM&amp;gt;&amp;quot;, normal.&lt;br /&gt;
&amp;lt;br&amp;gt;During trusting the Belgium CA, it created automatically a .gnupg/trustlist.txt with&lt;br /&gt;
 # CN=Belgium Root CA,C=BE&lt;br /&gt;
 DF:DF:AC:89:47:BD:F7:52:64:A9:23:3A:C1:0E:E3:D1:28:33:DA:CC S&lt;br /&gt;
&lt;br /&gt;
Ok let&#039;s try again without the CRLs check:&lt;br /&gt;
 $ gpgsm --disable-crl-checks --armor --sign --output mail.txt.smime mail.txt&lt;br /&gt;
 [...]&lt;br /&gt;
 gpgsm: signature created&lt;br /&gt;
I was prompted for my PIN during the process.&lt;br /&gt;
&lt;br /&gt;
And trying to verify, with CRLs:&lt;br /&gt;
 $ gpgsm --verify --output mail.txt mail.txt.smime&lt;br /&gt;
 gpgsm: Signature made 2008-02-06 21:42:40 using certificate ID 0x80211056&lt;br /&gt;
 gpgsm: note: non-critical certificate policy not allowed&lt;br /&gt;
 dirmngr[8994]: error opening `/home/phil/.gnupg/dirmngr_ldapservers.conf&#039;: Aucun fichier ou répertoire de ce type&lt;br /&gt;
 dirmngr[8994]: permanently loaded certificates: 0&lt;br /&gt;
 dirmngr[8994]:     runtime cached certificates: 0&lt;br /&gt;
 dirmngr[8994]: command ISVALID failed: Certificat révoqué&lt;br /&gt;
 gpgsm: certificate #100000000000E144CBC42E9BB2453EE4/2.5.4.5=#323030353037,CN=Citizen CA,C=BE&lt;br /&gt;
 gpgsm: certificate has been revoked&lt;br /&gt;
 gpgsm: invalid certification chain: Certificat révoqué&lt;br /&gt;
And without CRLs:&lt;br /&gt;
 $ gpgsm --disable-crl-checks --verify --output mail.txt mail.txt.smime          &lt;br /&gt;
 gpgsm: Signature made 2008-02-06 21:42:40 using certificate ID 0x80211056&lt;br /&gt;
 gpgsm: CRLs not checked due to --disable-crl-checks option&lt;br /&gt;
 gpgsm: Good signature from &amp;quot;/CN=Philippe Teuwen (Authentication)/C=BE/SerialNumber=...&lt;br /&gt;
&lt;br /&gt;
===e-Signing plugin for Firefox===&lt;br /&gt;
* pure curiosity...&lt;br /&gt;
* cf http://www.certipost.be/dpsolutions/en/e-signing-faq.html&lt;br /&gt;
* the plugin is signed so you&#039;ve to install the CA certificate of Certipost first and, cf above in my &amp;quot;funny facts&amp;quot;, for Firefox, you&#039;ve to download and... trust it.&amp;lt;br&amp;gt;The certificate is apparently no longer (broken link) and I could not find it in their search tool, the only thing I could find is [http://64.233.183.104/search?q=cache:vzHK3UKTuiMJ:www.certipost.be/en/certificates/PrimaryNormalisedCA/certificate_pem.cer+PrimaryNormalisedCA&amp;amp;hl=fr&amp;amp;ct=clnk&amp;amp;cd=3&amp;amp;gl=fr a copy of the pem version in Google cache(!)]&amp;lt;br&amp;gt;but that was good enough to be able to install the plugin.&lt;br /&gt;
* Moreover [https://connect.e-signing.be/app/en/create the form to sign] wants to directly execute some jar file but under an SSL connection signed by... the so-hard-to-get Certipost CA certificate, itself signed by GTE CyberTrust Global Root, an authority built-in in the browsers.&lt;br /&gt;
* You&#039;ve [https://www.certipost.be/webshop/ to pay] to be able to sign with your eID non-repudiation signature to have a valid &#039;&#039;Qualified Electronic Signature with long term value&#039;&#039;&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/images/stories/e-signing/right/technical_measures_en.pdf There are some explanations] of the additional services provided by CertiPost:&amp;lt;br&amp;gt;&#039;&#039;The applied XAdES-X-L is an XML signature format according to the recognized XAdES standard (ETSI TS 101 903 standard) that implements measures to satisfy the legal requirements for advanced electronic signatures as defined in the European Directive (EC 1999/93: European Community (EC) DIRECTIVE 1999/93/EC OF THE EUROPEAN PARLIAMENT AND COUNCIL ON A COMMUNITY FRAMEWORK FOR ELECTRONIC SIGNATURES) and for long term non-repudiation. Next to the electronic signature itself, the XAdES-X-Lfile contains the certificate that was used during the signature, the information to proof whether the certificate was valid when signing, and a time stamp to proof that all information used for signing existed and not altered since.&amp;lt;br&amp;gt;Moreover CertiPost keeps a copy of the signed information.&lt;br /&gt;
* Timestamps &amp;amp; storage look like additional features, not mandated by the law, so can I create a &#039;&#039;Qualified Electronic Signature with long term value&#039;&#039; out of the CertiPost context, so just a plain x509 signature?&lt;br /&gt;
&lt;br /&gt;
===SSH===&lt;br /&gt;
Inspired from http://simi.be/?page_id=9&lt;br /&gt;
&lt;br /&gt;
Getting the patch from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=355274 and porting it to v4.7p1&lt;br /&gt;
&amp;lt;br&amp;gt;Some rejs easy to solve from v4.2 to v4.7 and one less obvious change in debian/control: fix the debconf dependancies (was ${debconf:Depends} I think):&lt;br /&gt;
 Package: openssh-client-sc                                                          &lt;br /&gt;
 Architecture: any                                                                   &lt;br /&gt;
 Depends: ${shlibs:Depends}, debconf (&amp;gt;= 1.2.0) | debconf-2.0,...&lt;br /&gt;
&amp;lt;br&amp;gt;I recompile ssh with smartcard support.&lt;br /&gt;
 apt-get source openssh-client&lt;br /&gt;
 cd openssh-4.7p1&lt;br /&gt;
 patch -p1 &amp;lt; ../mypatch&lt;br /&gt;
 dpkg-buildpackage -uc -us -rfakeroot&lt;br /&gt;
Sending my public key to the ssh server:&lt;br /&gt;
 pkcs15-tool --read-ssh-key 2 |tail -n1|ssh user@host &#039;cat - &amp;gt;&amp;gt; ~/.ssh/authorized_keys&#039;&lt;br /&gt;
Then logging, being prompted for my PIN:&lt;br /&gt;
 ssh -I 0 user@host.com&lt;br /&gt;
===OpenID===&lt;br /&gt;
cf [[OpenID]] and [[OpenID-eID]] where I&#039;m hacking phpMyID to make my own&lt;br /&gt;
&lt;br /&gt;
===TODO: Login===&lt;br /&gt;
I tried https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/UsingOpenscTOC#logging_in_with_smartcards&lt;br /&gt;
but with the eID.&lt;br /&gt;
 apt-get install libpam-p11&lt;br /&gt;
See file:///usr/share/doc/libpam-p11/QuickStart.html&lt;br /&gt;
&amp;lt;br&amp;gt;Bad side: it conflicts with xlockmore :-(&lt;br /&gt;
&lt;br /&gt;
openssh way:&lt;br /&gt;
&amp;lt;br&amp;gt;Preparing the account with .ssh/authorized_keys, cf SSH auth on this page&lt;br /&gt;
&amp;lt;br&amp;gt;Edit /etc/pam.d/login and add before &amp;quot;@include common-auth&amp;quot; sth like:&lt;br /&gt;
 auth sufficient pam_p11_openssh.so /usr/lib/opensc-pkcs11.so&lt;br /&gt;
/var/log/auth.log tells: no certificates found&lt;br /&gt;
or&lt;br /&gt;
 auth sufficient pam_p11_openssh.so /usr/lib/libbeidpkcs11.so&lt;br /&gt;
/var/log/auth.log tells: fatal: pkcs11_sign failed &lt;br /&gt;
&amp;lt;br&amp;gt;before I was even prompted for my PIN&lt;br /&gt;
&lt;br /&gt;
opensc way: same results&lt;br /&gt;
 auth sufficient pam_p11_opensc.so /usr/lib/opensc-pkcs11.so&lt;br /&gt;
 auth sufficient pam_p11_opensc.so /usr/lib/libbeidpkcs11.so&lt;br /&gt;
preparing the account:&lt;br /&gt;
 mkdir ~/.eid&lt;br /&gt;
 chmod 0755 ~/.eid&lt;br /&gt;
 pkcs15-tool -r 2 &amp;gt; ~/.eid/authorized_certificates&lt;br /&gt;
 chmod 0644 ~/.eid/authorized_certificates&lt;br /&gt;
&lt;br /&gt;
So I still couldn&#039;t find a way.&lt;br /&gt;
&lt;br /&gt;
===TODO: SSL Auth===&lt;br /&gt;
http://blog.eikke.com/index.php/ikke/2007/10/29/using_your_belgian_eid_for_ssl_authentic&lt;br /&gt;
&lt;br /&gt;
 apt-get install libengine-pkcs11-openssl&lt;br /&gt;
&lt;br /&gt;
To generate a request, open a console and launch openssl. Once at the OpenSSL prompt, issue these 2 commands:&lt;br /&gt;
 engine -t dynamic -pre SO_PATH:/usr/lib/engines/engine_pkcs11.so -pre ID:pkcs11 -pre LIST_ADD:1 -pre LOAD -pre MODULE_PATH:/usr/lib/opensc-pkcs11.so&lt;br /&gt;
Adjust paths if necessary, of course. This loads the pkcs11 engine inside OpenSSL.&lt;br /&gt;
 req -engine pkcs11 -new -days 100 -key id_02 -keyform engine -out myrequest.csr -subj &amp;quot;/C=BE/ST=O-VL/O=My Organisation/CN=My Name/emailAddress=my@email.tld&amp;quot;&lt;br /&gt;
Adjust the days, out and subj parameters, at least. The key ID can be found using&lt;br /&gt;
 pkcs15-tool -c&lt;br /&gt;
Use the ID of the Authentication X509 certificate.&lt;br /&gt;
&lt;br /&gt;
===TODO: Apache SSL Reverse Proxy===&lt;br /&gt;
cf http://www.belgium.be/zip/eid_authentication_proxy_fr.html&lt;br /&gt;
===TODO: OpenGPG &amp;amp; x509===&lt;br /&gt;
Old dream is to sign an OpenPGP key with the eID, but even if technically possible, it probably breaks the validation chain as what Citizen CA signed was the entire certificate, not just the key/uid.&lt;br /&gt;
&amp;lt;br&amp;gt;Sth to check: [http://www.imc.org/ietf-openpgp/mail-archive/msg09930.html OpenPGP Signatures Incorporating X.509 Certificates]&lt;br /&gt;
&amp;lt;br&amp;gt;The solution is apparently to extend OpenGPG to allow special signatures on UIDs with sub-packets containing the entire certificate, the UID being build from the DN fields of the certificate (CN, EMAIL,...)&lt;br /&gt;
&amp;lt;br&amp;gt;Apparently PGP supports it already?&lt;br /&gt;
&lt;br /&gt;
===TODO: OpenVPN Auth===&lt;br /&gt;
http://christophe.vandeplas.com/2008/02/03/openvpn-belgian-eid&lt;br /&gt;
&amp;lt;br&amp;gt;But Debian openvpn 2.1_cr4 doesn&#039;t support yet --show-pkcs11-ids&lt;br /&gt;
===TODO: Other tools===&lt;br /&gt;
* [http://sourceforge.net/projects/opensignature OpenSignature] for Italia&lt;br /&gt;
* [http://openportalguard.sourceforge.net/ Open Portal Guard] for e.g. public administrations&lt;/div&gt;</summary>
		<author><name>212.71.5.64</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=2937</id>
		<title>Belgian eID</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=2937"/>
		<updated>2008-03-04T22:40:12Z</updated>

		<summary type="html">&lt;p&gt;212.71.5.64: /* My attempts under Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Belgian eID is part of the efforts of the government for [[Belgian eGov]]&lt;br /&gt;
==Officials==&lt;br /&gt;
&lt;br /&gt;
* [http://eid.belgium.be Official eID portal]&lt;br /&gt;
* [http://repository.eid.belgium.be/FR/Index.htm Certificates]&lt;br /&gt;
* [http://status.eid.belgium.be/ eID services]&lt;br /&gt;
* [http://crl.eid.belgium.be/ Revocation lists] and [http://ocsp.eid.belgium.be/ OCSP server]&lt;br /&gt;
* [http://eid.belgium.be/fr/navigation/documents/37129.html Circulaires (fr) eID Home  /  Villes et communes  /  Quoi  /  Circulaires]&amp;lt;br&amp;gt;Among others:&amp;lt;br&amp;gt; 3) FORMULAIRE DE RENONCIATION AUX CERTIFICATS DE LA CARTE D’IDENTITE ELECTRONIQUE AU MOMENT DE LA DEMANDE DE LA CARTE&amp;lt;br&amp;gt;10) MODELE D’ATTESTATION D’ACTIVATION OU DE REVOCATION DES CERTIFICATS APRES ACTIVATION DE LA CARTE&amp;lt;br&amp;gt;11) MODELE D’ATTESTATION DE SUSPENSION ET DE REACTIVATION DES CERTIFICATS&lt;br /&gt;
* [http://www.certipost.be CertiPost], by Belgacom &amp;amp; La Poste/De Post&lt;br /&gt;
** [http://www.certipost.be/x500/X500.html Certipost E-Trust™ Public X500 Directory Search]&lt;br /&gt;
&lt;br /&gt;
==Usage &amp;amp; Software==&lt;br /&gt;
&lt;br /&gt;
* [http://www.belgium.be/zip/eid_datacapture_fr.html Middleware &amp;amp; developer&#039;s kit]&lt;br /&gt;
** There are also Debian packages, cf below my tests under Linux&lt;br /&gt;
** [http://developer.novell.com/wiki/index.php/EID-belgium eID configuration toolkit by Novell]&lt;br /&gt;
* [http://homes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/WebHome Danny De Cock&#039;s page on eID] (same as http://www.godot.be)&lt;br /&gt;
* [http://weblogs.asp.net/cumpsd/archive/2005/04/03/396900.aspx short intro]&lt;br /&gt;
* [http://weblogs.asp.net/cumpsd/archive/2005/04/03/396901.aspx how to use the eID card within your .NET apps]&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
* http://www.foo.be/eID/ Official data, spec sheet etc (outdated)&lt;br /&gt;
* [http://belsec.skynetblogs.be/tag/1/E-ID Belsec blog entries] about the eID&lt;br /&gt;
* [http://www.uvcw.be/no_index/e-communes/dossier_eid/Belgian_eID_Run-time_Users_guide.pdf Belgian E-ID runtime guide windows/linux pdf]&lt;br /&gt;
* [http://www.porvoo8.rrn.fgov.be/porvoo8/doc13/09_porvoo8-bruegger18_Italy.pdf Open source interoperability and E-ID pdf]&lt;br /&gt;
* [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/5%20aspects%20techniques/fr/belpic_eid_version_numbering_v1.5.2.pdf The versioning of E-ID pdf]&lt;br /&gt;
* [http://porvoo10.net/p10/10_porvoo10-bud-25.pdf The road to European E-ID interoperability pdf]&lt;br /&gt;
* [http://www.microsoft.com/belux/nl/eid/ Microsoft and the eID], just an old marketing buzz? (I wouldn&#039;t complain...)&lt;br /&gt;
* [http://samba.grep.be/~wouter/beid-screencast.ogg], BeID screencast of what should have been shown at Fosdem 2008, by Wouter. (still waiting for the video of the presentation...)&lt;br /&gt;
* [http://www.lalibre.be/societe/cyber/article/404626/la-carte-d-identite-electronique-permettra-de-s-enregistrer-sur-ebay.html] La carte d&#039;identité électronique permettra de s&#039;enregistrer sur eBay&lt;br /&gt;
&lt;br /&gt;
==I revoked my certificates==&lt;br /&gt;
===Why?===&lt;br /&gt;
Because at that time I knew too few on the details of the eID architecture and too much about how a new security architecture can have flaws, so better to stay away for a while, especially given the legal implications that the eID can bring.&amp;lt;br&amp;gt;I knew they were talking about two certificates without understanding their difference, so let&#039;s revoke both.&amp;lt;br&amp;gt;Note that it doesn&#039;t mean my eID is not valid, eID card activation is mandatory. The eID card is a proof of identity and residence of a person in Belgium. eID certificates activation is a choice of the holder of the eID (opt-in), he/she can decide to activate or revoke the certificates. (cf [http://www.certipost.be/dpsolutions/en/eid-faq.html FAQ])&lt;br /&gt;
===How?===&lt;br /&gt;
It was quite epic.&lt;br /&gt;
&amp;lt;br&amp;gt;I was still a bit prepared, hopefully, so I had printed the Annexes 3 &amp;amp; 10, the legal forms to ask either to renounce to have the certificates or to revoke them just after activation, as well as the relevant parts of the User Manual for the civil servants :-)&lt;br /&gt;
&amp;lt;br&amp;gt;I printed both as for me it was not clear from the User Manual how to renounce for the certificates.&lt;br /&gt;
* [Me] Good morning, I come for my eID and... I want to get rid of the certificates&lt;br /&gt;
* [Her] You what? Is it possible? Never heard about that&lt;br /&gt;
* [Me] Yes, yes, see (and I show her what&#039;s in her User Manual)&lt;br /&gt;
* ... (takes a while to digest the info)&lt;br /&gt;
* [Her] Ha ok, you&#039;ve to fill Annex 3, (shouting behind her shoulder) JOSETTE, DO WE HAVE ANNEX 3???&lt;br /&gt;
* [Josette] ANNEX WHAT??&lt;br /&gt;
* [Me] No prob, look (and I pull out my own copy of [http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/03_-_FORMULAIRE_RENONCIATION_CERTIFS.pdf Annex 3 (pdf)])&lt;br /&gt;
* ... (meanwhile she has no idea what to do on the eID to fulfill renouncement and I agree with her, the Manual was unclear so we went for activation+revocation)&lt;br /&gt;
* [Me] No prob, look (and I pull out my own copy of [http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/10_-_Attestation_activ_Certificats(18-10)_27-07.pdf Annex 10 (pdf)])&lt;br /&gt;
* [Her] Can I take your copies before you fill them? I&#039;ll make copies for ourselves.&lt;br /&gt;
So today the official Annex 3&amp;amp;10 forms of this civil office are mine :-D&amp;lt;br&amp;gt;Who knows, maybe I crafted the form... ;-)&lt;br /&gt;
&lt;br /&gt;
It is &amp;quot;funny&amp;quot; to see that everywhere the activation of the certificates is presented as optional, the choice being left to the citizen, blablabla, but in reality most of the citizen just don&#039;t know about this possibility (and most of the civil servants, well I hope that since my story, things have evolved a bit) and the civil servants doesn&#039;t ask you the question.&lt;br /&gt;
&lt;br /&gt;
===Some details about those certificates===&lt;br /&gt;
The eID contains 2 signature certificates, so you cannot encrypt with them, just sign.&lt;br /&gt;
* One labeled &amp;quot;Authentication&amp;quot; is for daily use &lt;br /&gt;
** To log in on SSL websites such as [http://minfin.fgov.be/taxonweb/ Tax-on-web] or [http://www.saferchat.be SaferChat] or even your bank e.g. [http://www.keytradebank.com/pdf/eID_en.pdf Keytrade has implemented it (pdf)] with CRL check&lt;br /&gt;
** For signing mails with S/MIME&lt;br /&gt;
** For your own purpose, to log on your SSH server, SSL server, VPN etc&lt;br /&gt;
* One labeled &amp;quot;Signature&amp;quot; is for special cases&lt;br /&gt;
** It has a equivalent legal value as a hand-written signature and is referred as non-repudiation signature.&lt;br /&gt;
** According to [http://www.certipost.be/dpsolutions/images/stories/e-signing/right/applicability_en.pdf CertiPost applicability guidelines (pdf)], the electronic signature still cannot replace a hand-written signature in a number of cases&lt;br /&gt;
**It&#039;s automatically revoked for minors under 18 years as they cannot sign legally yet.&lt;br /&gt;
**From [http://www.certipost.be/dpsolutions/en/eid-faq.html Certipost FAQ]:&amp;lt;br&amp;gt;&#039;&#039;Non-repudiation guarantees that one cannot deny having performed an act. E.g. any message signed using a person&#039;s digital signature can only have come from this person. The signing person can not claim that the message was not originated by him.&amp;lt;br&amp;gt;In other words, non-repudiation means that information &#039;&#039;&#039;cannot be disclaimed&#039;&#039;&#039;, similar to a &#039;&#039;&#039;witnessed&#039;&#039;&#039; handwritten signature on a paper document.&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;to be checked in the law&#039;&#039;&lt;br /&gt;
** Normal pkcs software doesn&#039;t seem to be able to use it (?)&lt;br /&gt;
** Should be used only through the Government software which prompts you with a special GUI and warnings about the legal power of this signature&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/en/rem-overzicht.html CertiPost e-Registered mails] is using the non-repudiation signature&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/en/e-signing-overview.html CertiPost e-Signing] is using the non-repudiation signature&lt;br /&gt;
* Both are protected by the same PIN which is typed on your (unsafe) PC&lt;br /&gt;
&lt;br /&gt;
===What says the law===&lt;br /&gt;
Sorry, here are french version abstracts.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;9 JUILLET 2001. - Loi fixant certaines règles relatives au cadre juridique pour les signatures électroniques et les services de certification&#039;&#039;&#039;, date de publication au Moniteur: 29 septembre 2001&lt;br /&gt;
&amp;lt;br&amp;gt;Morceaux choisis:&lt;br /&gt;
* Art. 4. § 1er. A défaut de dispositions légales contraires, nul ne peut être contraint de poser un acte juridique par voie électronique.&lt;br /&gt;
* § 4. Sans préjudice des articles 1323 et suivants du Code civil, une signature électronique avancée réalisée sur la base d&#039;un certificat qualifié et conçue au moyen d&#039;un dispositif sécurisé de création de signature électronique, est assimilée à une signature manuscrite, qu&#039;elle soit réalisée par une personne physique ou morale.&lt;br /&gt;
* § 5. Une signature électronique ne peut être privée de son efficacité juridique et ne peut être refusée comme preuve en justice au seul motif :&lt;br /&gt;
** que la signature se présente sous forme électronique, ou&lt;br /&gt;
** qu&#039;elle ne repose pas sur un certificat qualifié, ou&lt;br /&gt;
** qu&#039;elle ne repose pas sur un certificat qualifié délivré par un prestataire accrédité de service de certification, ou&lt;br /&gt;
** qu&#039;elle n&#039;est pas créée par un dispositif sécurisé de création de signature.&lt;br /&gt;
* &#039;&#039;Wait a minute, ANY electronic signature NOT being based on a qualified certificate and NOT created in a secure environment CANNOT be refused as a legal proof???&amp;lt;br&amp;gt;Maybe it&#039;s me or the triple-negation sentences (lawyers, lawyers...) but it looks like § 5 goes much further than § 4&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===What do I think today?===&lt;br /&gt;
====Catastrophe scenario==== &lt;br /&gt;
* Someone captures your PIN while you&#039;re using it for &amp;quot;just authentication&amp;quot; via e.g. malware, virus, trojan, worm on the PC &lt;br /&gt;
** you know, the kind of stuff that never happens, anyway it&#039;s now [http://eid.belgium.be/fr/navigation/documents/39814.html your problem] even if the official middleware [http://blog.didierstevens.com/2007/12/31/how-can-i-trust-the-beid-runtime/ is not signed]&lt;br /&gt;
**And apparently even some readers with integrated keypads are [http://belsec.skynetblogs.be/post/5426553/belgian-eid-nr-11--keyloggers-work-with-eid not safer :-(]&lt;br /&gt;
**And apparently even commercial standalone smatcard terminals are [http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-711.pdf not safer :-( (pdf)]&lt;br /&gt;
**And, oh, I did a small test with [[Keyloggers|lkl, a userland keylogger]] and of course the PIN typed into the beid graphical prompt could be easily captured.&lt;br /&gt;
* He gets physical access to your eID, even briefly if he has e.g. a PDA with Internet &amp;amp; smartcard reader.&lt;br /&gt;
* Now he can sign with your legal signature anything you can imagine... and you cannot repudiate what he does.&lt;br /&gt;
* The fact that maybe legal signatures have to be crafted through CertiPost (cf e-signing below) doesn&#039;t change anything to this risk.&lt;br /&gt;
&lt;br /&gt;
====So what will I do next time?====&lt;br /&gt;
* I&#039;ll probably accept the Authentication certificate to be able to play around with it.&lt;br /&gt;
* For sure I&#039;ll revoke the Signature certificate unless they change their architecture.&lt;br /&gt;
** Not the same PIN than the other certificate.&lt;br /&gt;
** Better than 4 digits (&amp;amp; 3 attempts so 3 chances over 10000)&lt;br /&gt;
** Probably they limited themselves to one single small PIN in order to pass the [http://www.kafka.be Kafka test] ;-)&lt;br /&gt;
** Even then:&lt;br /&gt;
*** Then I could use it but only on trusted devices, that&#039;s another story...&lt;br /&gt;
*** You get the PIN &amp;amp; PUK by post if I remember well, this could be eavesdropped but you can change your PIN... So  as the PUK can unlock the PIN 12 times, the attacker has 36 chances over 10000, one over 278, mmm... And who said humans can generate random PINs? ;-)&lt;br /&gt;
&lt;br /&gt;
===Privacy and other security considerations===&lt;br /&gt;
* [http://idcorner.org/2005/07/04/the-belgian-eid-card-calamity/ Another] [http://www.idcorner.org/?p=121 consideration] I didn&#039;t talk about yet: PRIVACY&lt;br /&gt;
* Whoever sees your public certificate (which happens e.g. if you log to a SSL website with your card or &#039;&#039;&#039;if you simply send a signed email&#039;&#039;&#039;) sees your [http://www.ibz.rrn.fgov.be/ RRN (&amp;quot;rijksregistratienummer&amp;quot;)]&amp;lt;br&amp;gt;BTW here is [http://fr.wikipedia.org/wiki/Num%C3%A9ro_de_registre_national how it&#039;s constructed]: It is a total of 11 numbers of which the first 6 are your birthdate JJMMDD followed by three numbers to distinguish the people that were born on the same day (even for men, uneven for women) and the last two numbers are a control number. So if you know the birthdate and the sex of the person, and you know how the control sum is done (97-JJMMDDXXX%97), you only miss two and a half numbers coming from a linear incremental counter (001, 003,...) to recompile his national register number. For mine it takes less than 40 attempts it you proceed logically...&lt;br /&gt;
* [http://minfin.fgov.be/taxonweb/ Tax-on-web] announce it but what about the others and your mail correspondants?&amp;lt;br&amp;gt;&#039;&#039;Suite à l&#039;utilisation de votre moyen d&#039;authentification (carte d&#039;identité électronique ou token citoyen), le SPF Finances a connaissance de votre numéro de registre national.&amp;lt;br&amp;gt;Conformément à l&#039;arrêté royal du 25/04/1986 autorisant certaines autorités du Ministère des Finances à utiliser le numéro d&#039;identification du registre national des personnes physiques, votre numéro de registre national n&#039;est utilisé dans ce contexte qu&#039;à des fins d&#039;identification pour l&#039;accès aux applications du SPF Finances.&amp;lt;br&amp;gt;La loi du 8 décembre 1992 relative à la protection de la vie privée à l&#039;égard des traitements de données à caractère personnel s&#039;applique à ce traitement d&#039;identification dont le responsable est le SPF Finances, Boulevard Albert II, 33 à 1030 Bruxelles.&#039;&#039;&lt;br /&gt;
* Other &amp;quot;funny&amp;quot; facts: Belgium government doesn&#039;t bother about cross-certification with any common Root CA so when you want to visit an official site supposedly secured such as  https://ccff02.minfin.fgov.be/CCFF_Authentication/choseLoginMethod.do or https://mijndossier.rrn.fgov.be you&#039;re kindly asked to blindly trust the certificate, years after phishing was invented, sigh...&lt;br /&gt;
* And even &amp;quot;better&amp;quot;: for Firefox, [http://www.certipost.be/dpsolutions/en/e-signing-faq.html CertiPost e-Signing] requires you to download and install their CA certificate and to trust it for identifying everything: web sites, mail users and software! Here the download of the CA certificate is done... on pure http, sigh...&lt;br /&gt;
* [https://www.cosic.esat.kuleuven.be/adapid/ ADAPID project] is a consortium of researchers and industry representatives in Flanders decided to take action in an attempt to help avoid a national privacy calamity. After a first (non-public) report, the ADAPID project won the financial support of IWT-Flanders. ADAPID officially started July 1st, 2005 and will run until June 30th, 2009.&lt;br /&gt;
* Normally the third and definitive version of the eID should have been rolled out begin of this year (2008) but I&#039;ve no idea what are the changes.&lt;br /&gt;
* [http://www.cirb.irisnet.be/site/fr/eid/ethicalid/index_htm Ethical-ID] is a software which presents to the e.g. swimming pool employee the only relevant data e.g. the residence city.&lt;br /&gt;
&lt;br /&gt;
==My attempts under Linux==&lt;br /&gt;
I&#039;m using the [[IDream ID-SMID01 SmartCard reader]], bought for 10€&lt;br /&gt;
&lt;br /&gt;
Installing beidgui and dependencies:&lt;br /&gt;
 apt-get install beidgui beid-tools&lt;br /&gt;
 =&amp;gt; libopenct1 libpcsclite1 libbeidlibopensc2 libbeid2 beid-tools beidgui libccid pcscd &lt;br /&gt;
 less /usr/share/doc/libbeidlibopensc2/README.Debian&lt;br /&gt;
&lt;br /&gt;
The GUI application works well, including OCSP communication, showing me that my eID certificates are revoked, excellent!&lt;br /&gt;
&lt;br /&gt;
UPDATE: There is a version 2.6.0-3 available in unstable&lt;br /&gt;
 apt-get install -t unstable beidgui beid-tools&lt;br /&gt;
&lt;br /&gt;
There are 2 daemons provided with beid-tools:&lt;br /&gt;
* beidcrld&amp;lt;br&amp;gt;Automatic CRL download&lt;br /&gt;
* beidpcscd&amp;lt;br&amp;gt;The privacy filter monitors all commands sent to the card. When an application requests to read the identity data, address or photo from the eID card, the filter will display a message and ask the user&#039;s consent&lt;br /&gt;
&lt;br /&gt;
===Exploring===&lt;br /&gt;
 pkcs15-tool --dump&lt;br /&gt;
 pkcs15-tool --read-certificate 02 &amp;gt; my_auth.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 03 &amp;gt; my_sign.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 04 &amp;gt; belgium.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 06 &amp;gt;&amp;gt; belgium.crt&lt;br /&gt;
 openssl x509 -in my_auth.crt -text&lt;br /&gt;
 pkcs15-tool --read-ssh-key 2&lt;br /&gt;
 # For a little demo...&lt;br /&gt;
 beid-pkcs11-tool --slot 0 --login --test&lt;br /&gt;
There are 2 daemons but their usage is still unclear to me as everythingn works (or not) with or without those daemons.&lt;br /&gt;
* beidcrld, about keeping CRLs up-to-date?&lt;br /&gt;
* beidpcscd, ?, it&#039;s listening on port tcp 2500 and beidcrld, firefox-bin and icedove-bin are constantly speaking with it...&lt;br /&gt;
&lt;br /&gt;
===Firefox security module===&lt;br /&gt;
To add the security module to Firefox:&lt;br /&gt;
 apt-get install libbeid2-dev libbeidlibopensc2-dev&lt;br /&gt;
Visit file:///usr/share/beid/beid-pkcs11-register.html to install the service&lt;br /&gt;
&lt;br /&gt;
Now what?...&lt;br /&gt;
&amp;lt;br&amp;gt;cf http://eid.belgium.be/fr_BE/fed_ict/imported_content_eid/pdf/eID-FR-Firefox.pdf&lt;br /&gt;
&amp;lt;br&amp;gt;You can see your certificate in Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; View Certificates and you can trust the Belgium Root CA under the &amp;quot;Authorities&amp;quot; tab for e.g. &amp;quot;identifying mail users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can then connect to federal sites like [http://minfin.fgov.be/taxonweb/ Tax-on-web] or the [https://mondossier.rrn.fgov.be RRN], being identified by your card &amp;amp; PIN.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that it works only if I start Firefox after having the eID in place in the reader.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that I didn&#039;t get much further, being redirected to e.g.&lt;br /&gt;
this nonexistent page but the title speaks for itself ;-) https://mondossier.rrn.fgov.be/CertificateRevoked.html&lt;br /&gt;
&lt;br /&gt;
===Thunderbird security module===&lt;br /&gt;
To add the security module to Firefox:&lt;br /&gt;
 apt-get install libbeid2-dev libbeidlibopensc2-dev&lt;br /&gt;
Menu preferences-&amp;gt;advanced-&amp;gt;certificates-&amp;gt;security devices-&amp;gt;load&lt;br /&gt;
 Module name: Belgium Identity Card PKCS#11&lt;br /&gt;
 Module filename: /usr/lib/libbeidpkcs11.so&lt;br /&gt;
&lt;br /&gt;
You can see your certificate in Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; View Certificates and you can trust the Belgium Root CA under the &amp;quot;Authorities&amp;quot; tab for e.g. &amp;quot;identifying mail users&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Try to sign a first mail:&lt;br /&gt;
&amp;lt;br&amp;gt;Menu S-MIME -&amp;gt; Digitally sign this message -&amp;gt; setup certificate -&amp;gt; digital signing -&amp;gt; select your BELPIC auth certif&lt;br /&gt;
&lt;br /&gt;
I could successfully sign (with my PIN) and verify an email but only with the Authentication certificate, not the Signature certificate&lt;br /&gt;
&amp;lt;br&amp;gt;According to the snapshots of the official guide of the eID for Outlook, it&#039;s ok, the Authentication certificate must be used, the other being reserved for legal signatures.&lt;br /&gt;
&amp;lt;br&amp;gt;UPDATE: Well now that I saw that Wouter could sign with the signature certificate I tried again and indeed it works.&lt;br /&gt;
&lt;br /&gt;
One difficulty is that the certificate is not bound to an email address so the email client tells you sth like it&#039;s validly signed but no idea if the certificate owner corresponds to the sender email address.&lt;br /&gt;
&lt;br /&gt;
===Signing with pkcs15-crypt===&lt;br /&gt;
From https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/UsingOpenscTOC#using_opensc_smartcards_to_sign&lt;br /&gt;
&lt;br /&gt;
Signing text and extracting the public certificate:&lt;br /&gt;
 fortune &amp;gt; data.txt&lt;br /&gt;
 openssl sha1 -binary data.txt &amp;gt; data.sha1&lt;br /&gt;
 pkcs15-crypt --key 2 --sign --pkcs1 --sha-1 --input data.sha1 --output data.auth.sig&lt;br /&gt;
 pkcs15-tool --read-certificate 02 &amp;gt; my_auth.crt&lt;br /&gt;
&lt;br /&gt;
Verifying the signature:&lt;br /&gt;
 openssl x509 -in my_auth.crt -pubkey -noout &amp;gt; my_auth.pem&lt;br /&gt;
 openssl dgst -sha1 -verify my_auth.pem -signature data.auth.sig data.txt&lt;br /&gt;
&lt;br /&gt;
I tried to do the same with the signature certificate instead of the authentication certificate but I get an error:&lt;br /&gt;
 pkcs15-crypt --key 3 --sign --pkcs1 --sha-1 --input data.sha1 --output data.auth.sig&lt;br /&gt;
 [pkcs15-crypt] sec.c:67:sc_set_security_env: returning with: Not supported&lt;br /&gt;
 [pkcs15-crypt] pkcs15-sec.c:267:sc_pkcs15_compute_signature: sc_set_security_env() failed: Not supported&lt;br /&gt;
 Compute signature failed: Not supported&lt;br /&gt;
Indeed signing with the signature certificate and without a GUI showing a warning about the legal implication is forbidden.&lt;br /&gt;
&lt;br /&gt;
===Signing with GpgSM===&lt;br /&gt;
GpgSM is to X.509 what GnuPG is to OpenPGP, cf http://gnupg.org/aegypten/tech.en.html&lt;br /&gt;
&lt;br /&gt;
 apt-get install gpgsm dirmngr gnupg-agent pinentry-qt&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/gpg-agent.conf:&lt;br /&gt;
 no-grab&lt;br /&gt;
 default-cache-ttl 1800&lt;br /&gt;
 ignore-cache-for-signing&lt;br /&gt;
 allow-mark-trusted&lt;br /&gt;
&lt;br /&gt;
 ~/.bash_profile: (appending this stuff)&lt;br /&gt;
 # preparing gpg-agent:&lt;br /&gt;
 if test -f $HOME/.gpg-agent-info &amp;amp;&amp;amp; kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2&amp;gt;/dev/null; then&lt;br /&gt;
   GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info`&lt;br /&gt;
   export GPG_AGENT_INFO&lt;br /&gt;
 else&lt;br /&gt;
   eval `gpg-agent --daemon`&lt;br /&gt;
   echo $GPG_AGENT_INFO &amp;gt;$HOME/.gpg-agent-info&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/scdaemon.conf: (we disable internal CCID support as only libccid supports more or less my crappy reader)&lt;br /&gt;
 disable-ccid&lt;br /&gt;
 debug-level none&lt;br /&gt;
&lt;br /&gt;
 ~/.gnupg/gpgsm.conf:&lt;br /&gt;
 debug-level none&lt;br /&gt;
&lt;br /&gt;
Acquiring the certificates:&lt;br /&gt;
 $ gpgsm --learn-card&lt;br /&gt;
Actually I had to run it several times, the first time only the Belgium CA was extracted, then the Citizen CA and finally the 2 personal certificates. And the behavior is not really reproductible so you&#039;ve to run it till you&#039;ve the 4 certificates:&lt;br /&gt;
 $ gpgsm --list-keys&lt;br /&gt;
 /home/phil/.gnupg/pubring.kbx&lt;br /&gt;
 -----------------------------&lt;br /&gt;
      Subject: /CN=Belgium Root CA/C=BE&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Citizen CA/C=BE/SerialNumber=200507&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Philippe Teuwen (Authentication)/C=BE/SerialNumber=...&lt;br /&gt;
 [...] &lt;br /&gt;
      Subject: /CN=Philippe Teuwen (Signature)/C=BE/SerialNumber=...&lt;br /&gt;
To sign sth:&lt;br /&gt;
 $ gpgsm --sign mail.txt&lt;br /&gt;
Then I get prompted to trust Belgium CA and gpgsm fails &amp;quot;error creating signature: Certificat révoqué &amp;lt;GpgSM&amp;gt;&amp;quot;, normal.&lt;br /&gt;
&amp;lt;br&amp;gt;During trusting the Belgium CA, it created automatically a .gnupg/trustlist.txt with&lt;br /&gt;
 # CN=Belgium Root CA,C=BE&lt;br /&gt;
 DF:DF:AC:89:47:BD:F7:52:64:A9:23:3A:C1:0E:E3:D1:28:33:DA:CC S&lt;br /&gt;
&lt;br /&gt;
Ok let&#039;s try again without the CRLs check:&lt;br /&gt;
 $ gpgsm --disable-crl-checks --armor --sign --output mail.txt.smime mail.txt&lt;br /&gt;
 [...]&lt;br /&gt;
 gpgsm: signature created&lt;br /&gt;
I was prompted for my PIN during the process.&lt;br /&gt;
&lt;br /&gt;
And trying to verify, with CRLs:&lt;br /&gt;
 $ gpgsm --verify --output mail.txt mail.txt.smime&lt;br /&gt;
 gpgsm: Signature made 2008-02-06 21:42:40 using certificate ID 0x80211056&lt;br /&gt;
 gpgsm: note: non-critical certificate policy not allowed&lt;br /&gt;
 dirmngr[8994]: error opening `/home/phil/.gnupg/dirmngr_ldapservers.conf&#039;: Aucun fichier ou répertoire de ce type&lt;br /&gt;
 dirmngr[8994]: permanently loaded certificates: 0&lt;br /&gt;
 dirmngr[8994]:     runtime cached certificates: 0&lt;br /&gt;
 dirmngr[8994]: command ISVALID failed: Certificat révoqué&lt;br /&gt;
 gpgsm: certificate #100000000000E144CBC42E9BB2453EE4/2.5.4.5=#323030353037,CN=Citizen CA,C=BE&lt;br /&gt;
 gpgsm: certificate has been revoked&lt;br /&gt;
 gpgsm: invalid certification chain: Certificat révoqué&lt;br /&gt;
And without CRLs:&lt;br /&gt;
 $ gpgsm --disable-crl-checks --verify --output mail.txt mail.txt.smime          &lt;br /&gt;
 gpgsm: Signature made 2008-02-06 21:42:40 using certificate ID 0x80211056&lt;br /&gt;
 gpgsm: CRLs not checked due to --disable-crl-checks option&lt;br /&gt;
 gpgsm: Good signature from &amp;quot;/CN=Philippe Teuwen (Authentication)/C=BE/SerialNumber=...&lt;br /&gt;
&lt;br /&gt;
===e-Signing plugin for Firefox===&lt;br /&gt;
* pure curiosity...&lt;br /&gt;
* cf http://www.certipost.be/dpsolutions/en/e-signing-faq.html&lt;br /&gt;
* the plugin is signed so you&#039;ve to install the CA certificate of Certipost first and, cf above in my &amp;quot;funny facts&amp;quot;, for Firefox, you&#039;ve to download and... trust it.&amp;lt;br&amp;gt;The certificate is apparently no longer (broken link) and I could not find it in their search tool, the only thing I could find is [http://64.233.183.104/search?q=cache:vzHK3UKTuiMJ:www.certipost.be/en/certificates/PrimaryNormalisedCA/certificate_pem.cer+PrimaryNormalisedCA&amp;amp;hl=fr&amp;amp;ct=clnk&amp;amp;cd=3&amp;amp;gl=fr a copy of the pem version in Google cache(!)]&amp;lt;br&amp;gt;but that was good enough to be able to install the plugin.&lt;br /&gt;
* Moreover [https://connect.e-signing.be/app/en/create the form to sign] wants to directly execute some jar file but under an SSL connection signed by... the so-hard-to-get Certipost CA certificate, itself signed by GTE CyberTrust Global Root, an authority built-in in the browsers.&lt;br /&gt;
* You&#039;ve [https://www.certipost.be/webshop/ to pay] to be able to sign with your eID non-repudiation signature to have a valid &#039;&#039;Qualified Electronic Signature with long term value&#039;&#039;&lt;br /&gt;
* [http://www.certipost.be/dpsolutions/images/stories/e-signing/right/technical_measures_en.pdf There are some explanations] of the additional services provided by CertiPost:&amp;lt;br&amp;gt;&#039;&#039;The applied XAdES-X-L is an XML signature format according to the recognized XAdES standard (ETSI TS 101 903 standard) that implements measures to satisfy the legal requirements for advanced electronic signatures as defined in the European Directive (EC 1999/93: European Community (EC) DIRECTIVE 1999/93/EC OF THE EUROPEAN PARLIAMENT AND COUNCIL ON A COMMUNITY FRAMEWORK FOR ELECTRONIC SIGNATURES) and for long term non-repudiation. Next to the electronic signature itself, the XAdES-X-Lfile contains the certificate that was used during the signature, the information to proof whether the certificate was valid when signing, and a time stamp to proof that all information used for signing existed and not altered since.&amp;lt;br&amp;gt;Moreover CertiPost keeps a copy of the signed information.&lt;br /&gt;
* Timestamps &amp;amp; storage look like additional features, not mandated by the law, so can I create a &#039;&#039;Qualified Electronic Signature with long term value&#039;&#039; out of the CertiPost context, so just a plain x509 signature?&lt;br /&gt;
&lt;br /&gt;
===SSH===&lt;br /&gt;
Inspired from http://simi.be/?page_id=9&lt;br /&gt;
&lt;br /&gt;
Getting the patch from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=355274 and porting it to v4.7p1&lt;br /&gt;
&amp;lt;br&amp;gt;Some rejs easy to solve from v4.2 to v4.7 and one less obvious change in debian/control: fix the debconf dependancies (was ${debconf:Depends} I think):&lt;br /&gt;
 Package: openssh-client-sc                                                          &lt;br /&gt;
 Architecture: any                                                                   &lt;br /&gt;
 Depends: ${shlibs:Depends}, debconf (&amp;gt;= 1.2.0) | debconf-2.0,...&lt;br /&gt;
&amp;lt;br&amp;gt;I recompile ssh with smartcard support.&lt;br /&gt;
 apt-get source openssh-client&lt;br /&gt;
 cd openssh-4.7p1&lt;br /&gt;
 patch -p1 &amp;lt; ../mypatch&lt;br /&gt;
 dpkg-buildpackage -uc -us -rfakeroot&lt;br /&gt;
Sending my public key to the ssh server:&lt;br /&gt;
 pkcs15-tool --read-ssh-key 2 |tail -n1|ssh user@host &#039;cat - &amp;gt;&amp;gt; ~/.ssh/authorized_keys&#039;&lt;br /&gt;
Then logging, being prompted for my PIN:&lt;br /&gt;
 ssh -I 0 user@host.com&lt;br /&gt;
===OpenID===&lt;br /&gt;
cf [[OpenID]] and [[OpenID-eID]] where I&#039;m hacking phpMyID to make my own&lt;br /&gt;
&lt;br /&gt;
===TODO: Login===&lt;br /&gt;
I tried https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/UsingOpenscTOC#logging_in_with_smartcards&lt;br /&gt;
but with the eID.&lt;br /&gt;
 apt-get install libpam-p11&lt;br /&gt;
See file:///usr/share/doc/libpam-p11/QuickStart.html&lt;br /&gt;
&amp;lt;br&amp;gt;Bad side: it conflicts with xlockmore :-(&lt;br /&gt;
&lt;br /&gt;
openssh way:&lt;br /&gt;
&amp;lt;br&amp;gt;Preparing the account with .ssh/authorized_keys, cf SSH auth on this page&lt;br /&gt;
&amp;lt;br&amp;gt;Edit /etc/pam.d/login and add before &amp;quot;@include common-auth&amp;quot; sth like:&lt;br /&gt;
 auth sufficient pam_p11_openssh.so /usr/lib/opensc-pkcs11.so&lt;br /&gt;
/var/log/auth.log tells: no certificates found&lt;br /&gt;
or&lt;br /&gt;
 auth sufficient pam_p11_openssh.so /usr/lib/libbeidpkcs11.so&lt;br /&gt;
/var/log/auth.log tells: fatal: pkcs11_sign failed &lt;br /&gt;
&amp;lt;br&amp;gt;before I was even prompted for my PIN&lt;br /&gt;
&lt;br /&gt;
opensc way: same results&lt;br /&gt;
 auth sufficient pam_p11_opensc.so /usr/lib/opensc-pkcs11.so&lt;br /&gt;
 auth sufficient pam_p11_opensc.so /usr/lib/libbeidpkcs11.so&lt;br /&gt;
preparing the account:&lt;br /&gt;
 mkdir ~/.eid&lt;br /&gt;
 chmod 0755 ~/.eid&lt;br /&gt;
 pkcs15-tool -r 2 &amp;gt; ~/.eid/authorized_certificates&lt;br /&gt;
 chmod 0644 ~/.eid/authorized_certificates&lt;br /&gt;
&lt;br /&gt;
So I still couldn&#039;t find a way.&lt;br /&gt;
&lt;br /&gt;
===TODO: SSL Auth===&lt;br /&gt;
http://blog.eikke.com/index.php/ikke/2007/10/29/using_your_belgian_eid_for_ssl_authentic&lt;br /&gt;
&lt;br /&gt;
 apt-get install libengine-pkcs11-openssl&lt;br /&gt;
&lt;br /&gt;
To generate a request, open a console and launch openssl. Once at the OpenSSL prompt, issue these 2 commands:&lt;br /&gt;
 engine -t dynamic -pre SO_PATH:/usr/lib/engines/engine_pkcs11.so -pre ID:pkcs11 -pre LIST_ADD:1 -pre LOAD -pre MODULE_PATH:/usr/lib/opensc-pkcs11.so&lt;br /&gt;
Adjust paths if necessary, of course. This loads the pkcs11 engine inside OpenSSL.&lt;br /&gt;
 req -engine pkcs11 -new -days 100 -key id_02 -keyform engine -out myrequest.csr -subj &amp;quot;/C=BE/ST=O-VL/O=My Organisation/CN=My Name/emailAddress=my@email.tld&amp;quot;&lt;br /&gt;
Adjust the days, out and subj parameters, at least. The key ID can be found using&lt;br /&gt;
 pkcs15-tool -c&lt;br /&gt;
Use the ID of the Authentication X509 certificate.&lt;br /&gt;
&lt;br /&gt;
===TODO: Apache SSL Reverse Proxy===&lt;br /&gt;
cf http://www.belgium.be/zip/eid_authentication_proxy_fr.html&lt;br /&gt;
===TODO: OpenGPG &amp;amp; x509===&lt;br /&gt;
Old dream is to sign an OpenPGP key with the eID, but even if technically possible, it probably breaks the validation chain as what Citizen CA signed was the entire certificate, not just the key/uid.&lt;br /&gt;
&amp;lt;br&amp;gt;Sth to check: [http://www.imc.org/ietf-openpgp/mail-archive/msg09930.html OpenPGP Signatures Incorporating X.509 Certificates]&lt;br /&gt;
&amp;lt;br&amp;gt;The solution is apparently to extend OpenGPG to allow special signatures on UIDs with sub-packets containing the entire certificate, the UID being build from the DN fields of the certificate (CN, EMAIL,...)&lt;br /&gt;
&amp;lt;br&amp;gt;Apparently PGP supports it already?&lt;br /&gt;
&lt;br /&gt;
===TODO: OpenVPN Auth===&lt;br /&gt;
http://christophe.vandeplas.com/2008/02/03/openvpn-belgian-eid&lt;br /&gt;
&amp;lt;br&amp;gt;But Debian openvpn 2.1_cr4 doesn&#039;t support yet --show-pkcs11-ids&lt;br /&gt;
===TODO: Other tools===&lt;br /&gt;
* [http://sourceforge.net/projects/opensignature OpenSignature] for Italia&lt;br /&gt;
* [http://openportalguard.sourceforge.net/ Open Portal Guard] for e.g. public administrations&lt;/div&gt;</summary>
		<author><name>212.71.5.64</name></author>
	</entry>
</feed>