<?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=Dorian</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=Dorian"/>
	<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Special:Contributions/Dorian"/>
	<updated>2026-05-23T18:40:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=8788</id>
		<title>Belgian eID</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=8788"/>
		<updated>2014-04-18T20:45:56Z</updated>

		<summary type="html">&lt;p&gt;Dorian: /* Signing in Acrobat Reader */&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;
==News==&lt;br /&gt;
Generally speaking there are regularly interesting posts [http://belsec.skynetblogs.be/tag/1/EID on Belsec blog], check it as I don&#039;t maintain actively this news section&lt;br /&gt;
* 2010-06-01 : [http://www.owasp.org/images/0/01/The_Belgian_e-ID_hacker_vs_developer.pdf The Belgian e-ID: hacker vs developer], a presentation by Erwin Geirnaert and Frank Cornelis at OWASP Belgian chapter meeting&lt;br /&gt;
* 2009-06-04 : SNCB/NMBS announced [http://www.rtbf.be/info/belgique/mobilite/voyager-en-train-sans-billet-mais-avec-la-carte-didentite-electronique-113949 on the news (FR here)] and on their site that [http://buy.b-rail.be/eTicketing/ETicketOrdering/InitStrutsActionToWelcome.do?change=lc&amp;amp;lang=3 &amp;quot;The tickets bought via Ticket on line ... can be loaded onto your electronic identity card&amp;quot;]. How could they do that??&amp;lt;br&amp;gt;Actually this is not true, as they explain [http://www.b-rail.be/nat/E/popup/private/eid/index.php here]:&amp;lt;br&amp;gt;&#039;&#039;Your travel tickets are linked to the National Register Number (social security number) on your electronic identity card. Your tickets are not physically loaded onto your electronic identity card&#039;&#039;&amp;lt;br&amp;gt;Ok now I understand better. And one more way (after [[MOBIB]]) for the gov to know who goes where...&lt;br /&gt;
* 2009-01-16 : [http://www.datanews.be/nl/90-53-21981/article.html?cid=rss PME et indépendants peuvent demander un lecteur eID gratuit]&amp;lt;br&amp;gt;16 janvier 2009 -- Rédaction Data News &amp;lt;br&amp;gt;Pour promouvoir la déclaration TVA électronique, Fedict va distribuer des lecteurs de cartes eID gratuits aux PME et aux indépendants.&amp;lt;br&amp;gt;Depuis le 1er janvier, la déclaration TVA électronique obligatoire s&#039;applique à l&#039;ensemble des PME et indépendants. Tel était déjà le cas pour les entreprises moyennes et grandes. Seule l&#039;entreprise qui peut prouver qu&#039;elle ne dispose pas de la possibilité technique requise, peut demander aux Finances de pouvoir encore utiliser une déclaration TVA papier.&amp;lt;br&amp;gt;Fedict fournira un lecteur de cartes eID gratuit aux PME et aux indépendants qui n&#039;en possèdent pas encore, peut-on lire dans un communiqué de presse émanant du ministre de l&#039;entreprise et de la simplification, Vincent Van Quickenborne. Pour obtenir un lecteur de cartes gratuit, il suffit d&#039;envoyer un mail à &#039;servicedesk@fedict.be&#039;, avec la mention &amp;quot;déclaration TVA électronique&amp;quot;, le nom et le numéro d&#039;enregistrement de l&#039;entreprise et l&#039;adresse d&#039;envoi souhaitée.&lt;br /&gt;
* 2009-01-14 : [http://www.lachambre.be/kvvcr/showpage.cfm?section=/cricra&amp;amp;language=fr&amp;amp;cfm=dcricra.cfm?commID=0003&amp;amp;type=comm&amp;amp;cricra=cri&amp;amp;count=all&amp;amp;legislat=52 Question and answer about eID security at the &amp;quot;Commission de l&#039;Intérieur, des Affaires Générales et de la Fonction Publique&amp;quot;]&lt;br /&gt;
* 2009-01 : [http://nvd.nist.gov/nvd.cfm?cvename=CVE-2009-0049 Belgian eID: Vulnerability Summary for CVE-2009-0049]&amp;lt;br&amp;gt;Belgian eID middleware (eidlib) 2.6.0 and earlier does not properly check the return value from the OpenSSL EVP_VerifyFinal function, which allows remote attackers to bypass validation of the certificate chain via a malformed SSL/TLS signature for DSA and ECDSA keys, a similar vulnerability to CVE-2008-5077.&lt;br /&gt;
* Various blog posts&lt;br /&gt;
** [http://christophe.vandeplas.com/2008/06/26/eid-things eID things]&lt;br /&gt;
** [http://www.grep.be/blog/en/computer/play/ssh_with_beid SSH with Belgian electronic ID card]&lt;br /&gt;
** [http://www.paeps.cx/weblog/activism/why_you_should_distrust_beid.html Why you should distrust your Belgian eID card]&lt;br /&gt;
** [http://christophe.vandeplas.com/2008/09/30/belgian-eid-cards Belgian eID Cards]&lt;br /&gt;
** [http://www.paeps.cx/weblog/activism/the_eid_saga_continues.html The eID saga continues]&lt;br /&gt;
* 2008-06-13 : Interesting discussions [http://belsec.skynetblogs.be/post/5967702/what-does-the-study-about-eid-say- here] about the infamous [http://www.badongo.com/file/9863462 report]&lt;br /&gt;
* 2008-05-17 : Liège mairie de quartier du Thier-à-Liège this Saturday (Yes the office is open on Saturdays !) We received our new EID card, No more paper to sign (Annex 3 and 10) for revoking a certificate. (Maybe this is a bug in the administration ... The girl doesn&#039;t know the difference between the 2 certificates (auth. and sign). Worse: she doesn&#039;t  know the signification ... and the top of the top ... Event on the paper you receive from the administration, it is clearly written &#039;.. 2 certificates : 1 for signing and 1 for authentification&#039; BUT on the screen of the administration computer for the revokation : &#039;révoquer le certificat de signature&#039; et &#039;révoquer le certificat de non-répudiation&#039; (sorry french) : Find the mistake ... --Dorian&amp;lt;br&amp;gt;&#039;&#039;COMMENT&#039;&#039; Yes I know... Authentication and Signature refer to the technical PCKS#11 labeling of the 2 RSA certificates on the card. Both are actually used only for &amp;quot;signature&amp;quot; in the crypto sense. Legally, the &amp;quot;authentication&amp;quot; one is for signing anything like emails, login to websites etc and the other one is for the qualified signature (as by the European directive), if done in a &amp;quot;secure context&amp;quot; is legally equivalent to hand-written signature and is not repudiable.  Anyway thanks for the feedback! --Phil&lt;br /&gt;
* 2008-04-23 [http://belsec.skynetblogs.be/post/5799349/belgian-eid-and-the-microsoft-question Belgian EID and the Microsoft question]&lt;br /&gt;
* 2008-04-03..04 European e-ID Card Conference: Current Perspective and Initiatives from around Europe in Government and Business, &#039;&#039;K.U.Leuven&#039;&#039;, €450&lt;br /&gt;
* 2008-03-08 [http://belsec.skynetblogs.be/post/5631741/certipost-the-first-and-only-digital-signatur Certipost the first and only digital signature company approved by our Privacycommission]&lt;br /&gt;
* 2008-02-26 [http://www.levif.be/actualite/technologie/72-63-13441/la-carte-d-identite-electronique-pour-s-enregistrer-sur-ebay-.html The eID to register to eBay.be (fr)] [http://www.lalibre.be/societe/cyber/article/404626/la-carte-d-identite-electronique-permettra-de-s-enregistrer-sur-ebay.html and here (fr)]&lt;br /&gt;
* 2008-02-24 [http://fosdem.org/2008/schedule/events/debian_belgian_eid Presentation of Wouter Verhelst at FOSDEM about &#039;&#039;The Belgian electronic ID card in Debian&#039;&#039;]: [http://samba.grep.be/~wouter/beid-screencast.ogg screencast] and [http://meetings-archive.debian.net/pub/debian-meetings/2008/fosdem/ogg_theora/384x288/The_Belgian_electronic_ID_card_in_Debian___Wouter_Verhelst.ogg video]&lt;br /&gt;
* 2008-02-22 [http://www.datanews.be/fr/news/90-61-16807/belgacom-vend-sa-participation-dans-certipost.html Belgacom sells stake in Certipost (fr)] so now La Poste/De Post owns 100%&lt;br /&gt;
* News Resources:&lt;br /&gt;
** [http://belsec.skynetblogs.be/tag/1/E-ID Belsec blog entries] about the eID&lt;br /&gt;
&lt;br /&gt;
==Officials==&lt;br /&gt;
&lt;br /&gt;
* Major sources of documentation:&amp;lt;br&amp;gt;[http://eid.belgium.be Official eID portal]&amp;lt;br&amp;gt;[http://repository.eid.belgium.be/FR/TechDoc.htm docs on the repository]&amp;lt;br&amp;gt;[http://www.belgium.be/eportal/application?origin=relatedVertical.jsp&amp;amp;event=bea.portal.framework.internal.refresh&amp;amp;pageid=relatedIndexPage&amp;amp;navId=5933&amp;amp;content_category=doc_link_documentation docs on the ePortal]&amp;lt;br&amp;gt;[http://www.ibz.rrn.fgov.be/index.php?id=122&amp;amp;L=0 Direction Générale Institutions &amp;amp; Population], with an interesting news channel &lt;br /&gt;
** Google -&amp;gt; [http://www.belgium.be/zip/fedictmovie/movie_fr.html promotional movie (37Mb)] and [http://www.belgium.be/zip/movieEID_fr/START.html flash presentation] (down, [http://web.archive.org/web/20070714110813/http://www.belgium.be/zip/fedictmovie/Fedict_FR_Large.wmv archived wmv file])&lt;br /&gt;
** Google -&amp;gt; In the context of the e-Government initiative of the Belgian Federal Government, a project has been defined to design and develop a messaging environment that allows smooth message- based communication information exchange between different governmental institutions. This messaging environment is called the [http://www.belgium.be/zip/ume-api_fr.html Universal Messaging Engine – Version 2 (UME2) (zip)]&lt;br /&gt;
** Google [http://www.google.com/search?q=site:eid.belgium.be+inurl:imported_content_eid deeply], [http://www.google.com/search?q=site:www.belgium.be+inurl:zip deeply], [http://www.google.com/search?q=site:www.ibz.rrn.fgov.be+inurl:eID deeply]...&lt;br /&gt;
* [http://repository.eid.belgium.be/FR/Index.htm Certificates], also &amp;quot;raw&amp;quot; [http://certs.eid.belgium.be/ here] and the [https://stage-pki.belgium.be/ Belgium Root CA] site&lt;br /&gt;
* [http://status.eid.belgium.be/ eID services], check online the status of a certificate and search the delta CRLs&lt;br /&gt;
* [http://crl.eid.belgium.be/ Revocation lists] and [http://ocsp.eid.belgium.be/ OCSP server]&lt;br /&gt;
* [https://readers.eid.belgium.be Help website] for the eID-kits for kids&lt;br /&gt;
* [http://www.ibz.rrn.fgov.be/index.php?id=2605&amp;amp;L=1%2F%25 Circulaires] &amp;amp; [http://www.ibz.rrn.fgov.be/index.php?id=2607&amp;amp;L=1%2F%25 Instructions]&amp;lt;br&amp;gt;Among others:&amp;lt;br&amp;gt;[http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/3%20Instructions/fr/instructions_generales.pdf Instructions générales de la carte d&#039;identité électronique version du 14 novembre 2005] and its page 29 stating the possibility to revoke one or both certificates on card issuance&amp;lt;br&amp;gt;[http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/3%20Instructions/fr/ig_annexe3_formulaire_%20renonciation_certifs_suite_v19.pdf Annexe   3 : formulaire de renonciation aux certificats de la carte d&#039;identité électronique au moment de la demande de la carte]&amp;lt;br&amp;gt;[http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/3%20Instructions/fr/ig_annexe10_attestation_activ_certifs_18-10_27_07%20suite_v19.pdf Annexe 10 : modèle d&#039;attestation d&#039;activation ou de révocation des certificats après activation de la carte]&amp;lt;br&amp;gt;[http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/3%20Instructions/fr/ig_annexe10bis_generation_nouvelle_paire_certifs.pdf Annexe 10 bis : modèle d&#039;attestation de génération et d&#039;activation d&#039;une nouvelle paire de certificats après activation de la carte]&amp;lt;br&amp;gt;[http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/3%20Instructions/fr/instructions_generales_annexe_11-attestation_suspension_certificats_27-07.pdf Annexe 11 : modèle d&#039;attestation de suspension et de reactivation des certificats]&amp;lt;br&amp;gt;[http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/kidscard/3%20Instructions/fr/nouveau0309/3_ci_belge.pdf Application Belpic - Version 20.03 - 3. Carte d&#039;identité de belge]&lt;br /&gt;
* [http://map.eid.belgium.be/fr.html Map of eID applications]&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;
* [http://www.eid-shop.be/language_select/ eID shop], partners &amp;amp; implementations available&lt;br /&gt;
* [http://www.cardreaders.be cardreaders] officially supported&lt;br /&gt;
* [https://ecommunities.belgium.be eCommunities]&lt;br /&gt;
* [https://www.checkdoc.be/CheckDoc/ CheckDoc]&lt;br /&gt;
* [https://www.docstop.be/DocStop/ DocStop]&lt;br /&gt;
** [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/DockStop_CheckDoc/dossier_presse_05-12-08.pdf Presentation (pdf) FR]&lt;br /&gt;
* [http://welcome-to-e-belgium.be 2009 roadshow]&lt;br /&gt;
* [http://www.mypension.be MyPension]&lt;br /&gt;
* [https://www.socialsecurity.be SocialSecurity]&lt;br /&gt;
* [https://www.notaclick.be NotaClic], auctions! Want to buy a house à la &amp;quot;eBay&amp;quot;?&lt;br /&gt;
* [http://www.comptesdormants.be/ Comptes dormants], dormant accounts&lt;br /&gt;
* [http://www.db2p.be Assurances-groupe dormantes], dormant group insurances&lt;br /&gt;
&lt;br /&gt;
==Misc links==&lt;br /&gt;
* [http://homes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi Danny de Cock&#039;s site]&lt;br /&gt;
** his latest comprehensive [http://www.esat.kuleuven.be/~decockd/slides/20090427.crypto.technicalities.pdf presentation (pdf)]&lt;br /&gt;
* [https://www.cosic.esat.kuleuven.be/adapid/index.html adapID project]&lt;br /&gt;
* [http://www.eidcompany.be/ The eID Company]&lt;br /&gt;
** [https://signbox.eidcompany.be/ signing documents online], same [http://www.signbox.eu here]&lt;br /&gt;
* [http://www.microsoft.com/belux/nl/eid Microsoft&#039;s Belgian eID card website]&lt;br /&gt;
* [https://ettevotjaportaal.rik.ee/index.py?chlang=eng Estonian Company Registration Portal]&lt;br /&gt;
* [http://www.digipassforeid.be/ VASCO: Use your eID as Digipass to create OTP]&lt;br /&gt;
&lt;br /&gt;
==Specifications==&lt;br /&gt;
* Belgian Electronic Identity Card content&lt;br /&gt;
** [http://www.belgium.be/eportal/ShowDoc/fed_ict/imported_content/pdf/Belgian_Electronic_Identity_Card_content_v2.2_FR.pdf?contentHome=entapp.BEA_personalization.eGovWebCacheDocumentManager.fr v2.2 (pdf)] from [http://eid.belgium.be Official eID portal]&lt;br /&gt;
** [http://web.archive.org/web/*/http://www.rijksregister.fgov.be/cie/specifications_techniques/belgian_electronic_identity_card_content_v2.8.a.pdf v2.8a (pdf)] from [http://www.archive.org WaybackMachine], found ref in [http://csrc.nist.gov/publications/nistir/ir7284/nistir-7284.pdf this NIST document (pdf)]&amp;lt;br&amp;gt;Ok the document actually [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/5%20aspects%20techniques/fr/belgian_electronic_identity_card_content_v2.8.a.pdf moved to the new website]&lt;br /&gt;
*** That version skips v2.2 in the Document Change History, very strange...&lt;br /&gt;
*** See also [https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/EidForums/ForumEidCardCertificates0037?t=2008-03-20T12:04:34Z this discussion]&lt;br /&gt;
* Description of the Belpic EID-version numbering&lt;br /&gt;
** [http://www.belgium.be/eportal/ShowDoc/fed_ict/imported_content/pdf/eID-version_numbering_v1_6_8_FR.pdf?contentHome=entapp.BEA_personalization.eGovWebCacheDocumentManager.fr v1.6.8] from [http://eid.belgium.be Official eID portal]&lt;br /&gt;
* Public User Specification BELPIC Application&lt;br /&gt;
** [http://www.belgium.be/zip/IdentityMiddlewareSpecs.zip V2.0 (pdf in zip)]&lt;br /&gt;
** I found [http://www.mkik.hu/download.php?id=726 this doc] on the [http://www.mkik.hu/index.php?id=634 Hungarian Chamber of Commerce &amp;amp; Industry], even in a [http://www.mkik.hu/download.php?id=727 version partly translated in hungarian]&amp;lt;br&amp;gt;The end of that document is the Public User Specification BELPIC Application but badly formatted&amp;lt;br&amp;gt;Apparently it ended up on this site as [http://www.mkik.hu/download.php?id=724 part of a publication for the European institutions]&lt;br /&gt;
* EID-Readers technical compatibility&lt;br /&gt;
** [http://www.belgium.be/eportal/ShowDoc/fed_ict/imported_content/pdf/Readers_technical_compatibility_v2.7.3_FR.pdf?contentHome=entapp.BEA_personalization.eGovWebCacheDocumentManager.fr  v2.7.3 (pdf)] from [http://eid.belgium.be Official eID portal]&lt;br /&gt;
** [http://www.foo.be/eID/opensc-belgium/BEID-ReaderSpecs-v2.7.5.pdf v2.7.5 (pdf)]&lt;br /&gt;
* Belgian Electronic Identity Card Middleware Programmers Guide&lt;br /&gt;
** [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/5%20aspects%20techniques/fr/programmers_guide_v1.1.pdf v1.1 (pdf)]&lt;br /&gt;
** [http://www.belgium.be/zip/IdentityMiddlewareSpecs.zip v1.4 (pdf in zip)]&lt;br /&gt;
* Belgian eID Toolkit Developer&#039;s guide&lt;br /&gt;
** [http://www.belgium.be/zip/IdentityMiddlewareSpecs.zip v1.0i (pdf in zip)]&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;
* [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://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 (nl)] ([http://www.microsoft.com/belux/fr/eid/ or (fr)]), just an old marketing buzz? (I wouldn&#039;t complain...)&lt;br /&gt;
* [http://homes.esat.kuleuven.be/~decockd/site/EidCards/belpic/mySlides/belgian.eid.card.technical.overview.pdf Belgian eID Card Technicalities (pdf)] by Danny de Cock, a MUST to read if you want to know all the gory details about the eID!&lt;br /&gt;
* New [http://code.google.com/p/eid-applet/ eid-applet] project on Google Code&lt;br /&gt;
&lt;br /&gt;
==Revoking certificates==&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;
====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;
===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;But [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/4%20Circulaires/fr/060125_III-38-0149-2006-Communication-Commentaires%20et%20clarifications-FR%20(PW).pdf officially (see &amp;quot;Puis-je utiliser le numéro de Registre national?&amp;quot;)] this is normal...&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 women, uneven for men) 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...&amp;lt;br&amp;gt;You can import Belgium Root CA signed by GlobalSign Root CA [http://certs.eid.belgium.be/ here (the belgiumrs*.crt)]&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;
* And what about [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/fr/8_documentation/communique_de_presse/presse_150208_2.pdf administrative errors]? ;-)&lt;br /&gt;
&lt;br /&gt;
===2005: 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 was 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://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/3%20Instructions/fr/ig_annexe3_formulaire_%20renonciation_certifs_suite_v19.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://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/3%20Instructions/fr/ig_annexe10_attestation_activ_certifs_18-10_27_07%20suite_v19.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;
[https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/EidForums/ForumEidCards0014 According to Danny de Cock] you can revoke them by phone via the eID card stop service: call +32-2-518.21.16 or +32.2.518.21.17,in French or Dutch, respectively (there is a 7-day period prior to definitive revocation, I&#039;m not sure how secure is the procedure...)&lt;br /&gt;
&lt;br /&gt;
===2010: I revoked my signature certificate, but kept my authentication certificate===&lt;br /&gt;
====Why?====&lt;br /&gt;
* Since 2005 I learned...&lt;br /&gt;
* I accept the Authentication certificate to be able to play around with it (Tax-on-web, RRN website,...).&lt;br /&gt;
** We can change the 4-digit PIN to up to a 12-digit value.&lt;br /&gt;
** I could use it but only on trusted devices, that&#039;s another story...&lt;br /&gt;
* I revoke the Signature certificate unless they change their architecture:&lt;br /&gt;
** I don&#039;t want the same PIN as on the other certificate. &amp;lt;br&amp;gt;Note that there were [https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/EidForums/ForumEidCards0015 some discussions here]&amp;lt;br&amp;gt;Public user specification BELPIC application v2.0 mention 2 different PINs with their own ids (01 for auth, 04 for non-repud) and [https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/EidForums/ForumEidCards0067 according to Danny] the new cards will have 2 PINs but as of today (2010) this is not yet the case.&lt;br /&gt;
** Probably they limited themselves to one single PIN in order to pass the [http://www.kafka.be Kafka test] ;-)&lt;br /&gt;
====How?====&lt;br /&gt;
It was again epic...&lt;br /&gt;
&amp;lt;br&amp;gt;The municipality employee claimed that I should have asked to not have the certificate while ordering the card and now it&#039;s too late, because rules have changed, blabla.&lt;br /&gt;
&amp;lt;br&amp;gt;She claimed that if she revokes now my certificates my cards will automatically expire 7 days later.&lt;br /&gt;
&amp;lt;br&amp;gt;So I took the risk and asked her to revoke my signature certificate, anyway, at my own risks.&lt;br /&gt;
&amp;lt;br&amp;gt;It was indeed quite risky as she was about to revoke the authentication certificate on the application screen rather than the signature certificate, so be very careful and double-check what they&#039;re doing!!&lt;br /&gt;
&lt;br /&gt;
The reality:&lt;br /&gt;
* My card is still fully working and I can use it to log into federal websites.&lt;br /&gt;
* There were indeed [http://www.ibz.rrn.fgov.be/index.php?id=2607 new eID instructions] published on 1st of July 2010 (one month after I got my card)&lt;br /&gt;
** The new instructions suppressed annexes 10, 10bis &amp;amp; 11 amongst other things, leaving only annex 3.&lt;br /&gt;
** If you refuse your certificates while ordering your card you will not have any usage certificate while I wanted to have anyway the authentication certificate.&lt;br /&gt;
** To get the municipality understanding what you want, the best is probably to refer to the instructions of the latest [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/3%20Instructions/fr/30062010/IG_POPEID_IST_010710.pdf instructions (pdf 01/06/2010)]&lt;br /&gt;
** &#039;&#039;&#039;UPDATE&#039;&#039;&#039; new version of the instructions is [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/3%20Instructions/fr/20120810/20120810-instructions-generales-eid.pdf here (pdf 10/08/2012)] but contains the same text in &#039;&#039;6.3 Activation de la carte - cas particuliers&#039;&#039;&lt;br /&gt;
 Instructions générales relatives aux cartes d’identité électroniques de Belges&lt;br /&gt;
 Version du 1er juillet 2010&lt;br /&gt;
 6. Délivrance de la carte au citoyen&lt;br /&gt;
 6.3 Activation de la carte&lt;br /&gt;
 Conformément à la loi du 25 mars 2003, le certificat qualifié de signature n’est pas validé sur la carte d’identité des&lt;br /&gt;
 personnes reconnues incapables en vertu de la législation en vigueur (mineurs d’âge non émancipés, personnes sous&lt;br /&gt;
 statut de minorité prolongée, les majeurs placés sous administration provisoire, les incapables légaux, les incapables&lt;br /&gt;
 juridiques et les personnes placées sous conseil judiciaire). En effet, ces personnes ne peuvent signer valablement.&lt;br /&gt;
&lt;br /&gt;
 Pour les mineurs d’âge non émancipés, lors de l’activation de la carte, le certificat de signature est automatiquement&lt;br /&gt;
 révoqué et le certificat d’authentification est quant à lui activé.&lt;br /&gt;
&lt;br /&gt;
 Pour les personnes reconnues incapables et mentionnées ci-dessus, après activation de la carte, il y a lieu de révoquer le&lt;br /&gt;
 certificat de signature (Logiciel Belpic – Menu : « Gestion des certificats »)&lt;br /&gt;
&lt;br /&gt;
 A l&#039;issue de la procédure d’activation de la carte d’une personne majeure ou d’un mineur émancipé, le préposé de la&lt;br /&gt;
 commune s’informe du souhait du citoyen quant à l’utilisation ou non des fonctions électroniques (certificat de signature et&lt;br /&gt;
 certificat d’authentification) de sa carte. Au cas où le citoyen décide de renoncer à l’utilisation de l’un ou /et l’autre&lt;br /&gt;
 certificat de sa carte, le préposé de la commune procédera à la révocation immédiate de son/ses certificat(s) (cfr. Logiciel&lt;br /&gt;
 Belpic, menu « Gestion des certificats »). Ensuite, la carte d&#039;identité électronique peut être remise au citoyen.&lt;br /&gt;
The last paragraph is very clear. Of course don&#039;t expect them to ask you if you wish to use the certificates or not, they never do it and when you ask for revoking a certificate it&#039;s always mess &amp;amp; fuzz.&lt;br /&gt;
&lt;br /&gt;
==PIN unlocking==&lt;br /&gt;
* Default PIN is 4-digit, can be changed up to 12 digits.&lt;br /&gt;
* PIN locked after 3 wrong attempts&lt;br /&gt;
* PUK can unlock PIN&lt;br /&gt;
* PUK is 12-digit long&lt;br /&gt;
* You get 6-digit half-PUK, and you need to go to the municipality to have your eID card unblocked... This unblocking consists of sending 12 PUK digits to your eID card: you provide 6 PUK digits, and the National Register provides the other 6... I.e., it is impossible for a citizen to unblock his/her eID card without presenting him/herself to the municipality... [https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/EidForums/ForumEidCards0067 Thanks for the info Danny]!&lt;br /&gt;
&lt;br /&gt;
==Linux: Drivers==&lt;br /&gt;
If you want to try also [https://readers.eid.belgium.be/index.cfm?Content_ID=8515371 make sure you&#039;re using Linux] :-D&lt;br /&gt;
&lt;br /&gt;
I&#039;m using the [[IDream ID-SMID01 SmartCard reader]], bought for 10€&lt;br /&gt;
&amp;lt;br&amp;gt;So the card is accessed via the USB reader, handled by the libccid, used by the pcscd daemon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pcsc_scan&lt;br /&gt;
 Reader 0: iDream ID-SMID01 00 00&lt;br /&gt;
  Card state: Card inserted, &lt;br /&gt;
  ATR: 3B 98 13 40 0A A5 03 01 01 01 AD 13 11&lt;br /&gt;
&lt;br /&gt;
ATR: 3B 98 13 40 0A A5 03 01 01 01 AD 13 11&lt;br /&gt;
+ TS = 3B --&amp;gt; Direct Convention&lt;br /&gt;
+ T0 = 98, Y(1): 1001, K: 8 (historical bytes)&lt;br /&gt;
  TA(1) = 13 --&amp;gt; Fi=372, Di=4, 93 cycles/ETU (38400 bits/s at 3.57 MHz)&lt;br /&gt;
  TD(1) = 40 --&amp;gt; Y(i+1) = 0100, Protocol T = 0 &lt;br /&gt;
-----&lt;br /&gt;
  TC(2) = 0A --&amp;gt; Work waiting time: 960 x 10 x (Fi/F)&lt;br /&gt;
+ Historical bytes: A5 03 01 01 01 AD 13 11&lt;br /&gt;
  Category indicator byte: A5 (proprietary format)&lt;br /&gt;
&lt;br /&gt;
Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):&lt;br /&gt;
3B 98 13 40 0A A5 03 01 01 01 AD 13 11&lt;br /&gt;
        Belgium Electronic ID card&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux: Government Middleware v2.1==&lt;br /&gt;
===Installation===&lt;br /&gt;
The Belgian government is providing a Linux middleware to access the eID.&lt;br /&gt;
&amp;lt;br&amp;gt;The sources are accessible [http://www.belgium.be/zip/eid_datacapture_fr.html here (fr)] or [http://www.belgium.be/zip/eid_datacapture_fr.html there (nl)]&lt;br /&gt;
&amp;lt;br&amp;gt;But thanks to Wouter Verhelst, there are also Debian packages (2.6.0-3 in Lenny as I&#039;m writing):&lt;br /&gt;
&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;
Some interesting documentation once it&#039;s installed: /usr/share/doc/libbeidlibopensc2/README.Debian&lt;br /&gt;
&lt;br /&gt;
A short introduction to the middleware is available [http://www.belgium.be/zip/middleware_Linux_FR.pdf here (fr, pdf)] or [http://www.belgium.be/zip/middleware_Linux_NL.pdf here (nl, pdf)]&lt;br /&gt;
===Belpic version of OpenSC===&lt;br /&gt;
The middleware is a modified version of OpenSC, talking to pcscd.&lt;br /&gt;
&amp;lt;br&amp;gt;I recently saw that my ~/.xsession-errors logfile was full of &#039;&#039;Error: can&#039;t open /var/run/openct/status...&#039;&#039;&amp;lt;br&amp;gt;It happens whenever icedove/iceweasel are open (so when the libbeidpkcs11.so is loaded) I found a [https://bugs.launchpad.net/ubuntu/+source/belpic/+bug/70442 bugreport on Ubuntu] and the proposed fix works so I opened a Debian bugreport: [http://bugs.debian.org/469485 #469485]:&lt;br /&gt;
&lt;br /&gt;
OpenSC has support for three driver types : PCSC, OpenCT and CT-API. Belpic only needs PC/SC, and will produce errors/warnings if you leave support for OpenCT enabled.&lt;br /&gt;
&lt;br /&gt;
Edit /etc/beidbase.conf, and insert a statement that limits the use of drivers to pcsc. Right before the reader_driver config feels like an OK place to do this :&lt;br /&gt;
&lt;br /&gt;
 ## specify driver family pcsc.&lt;br /&gt;
 # Others (openct, ..) are not needed for Belpic and&lt;br /&gt;
 # may produce errors/warnings&lt;br /&gt;
 &lt;br /&gt;
        reader_drivers = pcsc ;&lt;br /&gt;
 &lt;br /&gt;
 reader_driver pcsc {&lt;br /&gt;
      ....&lt;br /&gt;
===GUI===&lt;br /&gt;
The GUI application (beidgui) works well, including OCSP communication, showing me that my eID certificates are revoked, excellent!&lt;br /&gt;
&amp;lt;br&amp;gt;You can easily change your PIN here, with a PIN between 4 and 12 digits!&lt;br /&gt;
&amp;lt;br&amp;gt;I don&#039;t remember of having read that PINs bigger than 4-digit were possible...&lt;br /&gt;
&lt;br /&gt;
===beidcrld===&lt;br /&gt;
Part of beid-tools&lt;br /&gt;
&amp;lt;br&amp;gt;It&#039;s an optional daemon, supposed to download automatically the CRLs.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;TODO&#039;&#039;&#039;: where are those CRLs stored locally? How to check the status? /usr/share/beid/crl&lt;br /&gt;
&lt;br /&gt;
===beidpcscd===&lt;br /&gt;
Part of beid-tools&lt;br /&gt;
&amp;lt;br&amp;gt;It&#039;s an optional daemon.&lt;br /&gt;
&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, Iceweasel &amp;amp; Icedove (through the PKCS#11 module we&#039;ll install later) are constantly speaking with it...&lt;br /&gt;
&amp;lt;br&amp;gt;And if it&#039;s not running, Iceweasel &amp;amp; Icedove will poll every second on that port 2500, no matter if you are really using the eID at that moment or not, erk!&lt;br /&gt;
&lt;br /&gt;
===beid-pkcs11-tool===&lt;br /&gt;
Part of beid-tools&lt;br /&gt;
&amp;lt;br&amp;gt;For a little demo...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ beid-pkcs11-tool --list-slots&lt;br /&gt;
Available slots:&lt;br /&gt;
Slot 0           iDream ID-SMID01 00 00&lt;br /&gt;
  manufacturer:  Zetes&lt;br /&gt;
  hardware ver:  1.0&lt;br /&gt;
  firmware ver:  1.0&lt;br /&gt;
  flags:         token present, removable device, hardware slot&lt;br /&gt;
  token label:   BELPIC (Basic PIN)&lt;br /&gt;
  token manuf:   Axalto&lt;br /&gt;
  token model:   Belgium eID&lt;br /&gt;
  token flags:   rng, PIN initialized, token initialized&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ beid-pkcs11-tool --list-objects&lt;br /&gt;
Private Key Object; RSA 1024 bits&lt;br /&gt;
  label:      Authentication&lt;br /&gt;
  ID:         02&lt;br /&gt;
  Usage:      sign&lt;br /&gt;
Certificate Object, type = X.509 cert&lt;br /&gt;
  label:      Authentication&lt;br /&gt;
  ID:         02&lt;br /&gt;
Public Key Object; RSA 1024 bits&lt;br /&gt;
  label:      Authentication&lt;br /&gt;
  ID:         02&lt;br /&gt;
  Usage:      encrypt, verify&lt;br /&gt;
Certificate Object, type = X.509 cert&lt;br /&gt;
  label:      CA&lt;br /&gt;
  ID:         00&lt;br /&gt;
Public Key Object; RSA 2048 bits&lt;br /&gt;
  label:      CA&lt;br /&gt;
  ID:         04&lt;br /&gt;
  Usage:      encrypt, verify&lt;br /&gt;
Certificate Object, type = X.509 cert&lt;br /&gt;
  label:      Root&lt;br /&gt;
  ID:         00&lt;br /&gt;
Public Key Object; RSA 2048 bits&lt;br /&gt;
  label:      Root&lt;br /&gt;
  ID:         06&lt;br /&gt;
  Usage:      encrypt, verify&lt;br /&gt;
Private Key Object; RSA 1024 bits&lt;br /&gt;
  label:      Signature&lt;br /&gt;
  ID:         03&lt;br /&gt;
  Usage:      sign&lt;br /&gt;
Certificate Object, type = X.509 cert&lt;br /&gt;
  label:      Signature&lt;br /&gt;
  ID:         03&lt;br /&gt;
Public Key Object; RSA 1024 bits&lt;br /&gt;
  label:      Signature&lt;br /&gt;
  ID:         03&lt;br /&gt;
  Usage:      encrypt, verify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ beid-pkcs11-tool --list-mechanisms&lt;br /&gt;
Supported mechanisms:&lt;br /&gt;
  SHA-1, digest&lt;br /&gt;
  MD5, digest&lt;br /&gt;
  RIPEMD160, digest&lt;br /&gt;
  RSA-PKCS, sign, verify, unwrap&lt;br /&gt;
  SHA1-RSA-PKCS, sign, verify&lt;br /&gt;
  MD5-RSA-PKCS, sign, verify&lt;br /&gt;
  RIPEMD160-RSA-PKCS, sign, verify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ beid-pkcs11-tool --test&lt;br /&gt;
C_SeedRandom() and C_GenerateRandom():&lt;br /&gt;
  seems to be OK&lt;br /&gt;
Digests:&lt;br /&gt;
  all 4 digest functions seem to work&lt;br /&gt;
  MD5: OK&lt;br /&gt;
  SHA-1: OK&lt;br /&gt;
  RIPEMD160: OK&lt;br /&gt;
Signatures (currently only RSA signatures)&lt;br /&gt;
  testing key 0 (Authentication) &lt;br /&gt;
QSettings: failed to open file &#039;/etc/qt3/qt_plugins_3.3rc&#039;&lt;br /&gt;
  all 4 signature functions seem to work&lt;br /&gt;
  testing signature mechanisms:&lt;br /&gt;
    RSA-PKCS: OK&lt;br /&gt;
    SHA1-RSA-PKCS: OK&lt;br /&gt;
    MD5-RSA-PKCS: OK&lt;br /&gt;
    RIPEMD160-RSA-PKCS: OK&lt;br /&gt;
  testing key 1 (Signature) with 1 signature mechanism&lt;br /&gt;
    RSA-PKCS: OK&lt;br /&gt;
Verify (currently only for RSA):&lt;br /&gt;
  testing key 0 (Authentication)&lt;br /&gt;
    RSA-PKCS: OK&lt;br /&gt;
    SHA1-RSA-PKCS: OK&lt;br /&gt;
    MD5-RSA-PKCS: OK&lt;br /&gt;
    RIPEMD160-RSA-PKCS: OK&lt;br /&gt;
  testing key 1 (Signature) with 1 mechanism&lt;br /&gt;
    RSA-PKCS: OK&lt;br /&gt;
Key unwrap (RSA)&lt;br /&gt;
  testing key 0 (Authentication)  -- can&#039;t be used to unwrap, skipping&lt;br /&gt;
  testing key 1 (Signature)  -- can&#039;t be used to unwrap, skipping&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===libbeidpkcs11.so===&lt;br /&gt;
It&#039;s a PKCS#11 library which can be used by Firefox/Iceweasel, Thunderbird/Icedove, Iceape, OpenOffice,...&lt;br /&gt;
&amp;lt;br&amp;gt;See below for some tests with those applications.&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;
If installing the service through beid-pkcs11-register.html does not work, try to load /usr/lib/libbeidpkcs11.so manually through Edit -&amp;gt; Preferences -&amp;gt; Advanced -&amp;gt; Encryption -&amp;gt; Security devices -&amp;gt; Load.&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;
====Chrome/Chromium security module====&lt;br /&gt;
See https://code.google.com/p/eid-mw/wiki/ChromeLinux&lt;br /&gt;
 apt-get install libnss3-tools&lt;br /&gt;
 cd # be in your homedir&lt;br /&gt;
 modutil -dbdir sql:.pki/nssdb/ -add &amp;quot;Belgium eID&amp;quot; -libfile /usr/lib/libbeidpkcs11.so&lt;br /&gt;
Check if the library was successfully added&lt;br /&gt;
 modutil -dbdir sql:.pki/nssdb/ -list&lt;br /&gt;
&lt;br /&gt;
====Signing in OpenOffice====&lt;br /&gt;
It is using the same certificate set as firefox/iceweasel so signing in OpenOffice works out-of-the-box on my Debian.&lt;br /&gt;
&amp;lt;br&amp;gt;If not you can still check [http://www.linux.com/articles/57554 this article] to debug your situation.&lt;br /&gt;
&lt;br /&gt;
 File -&amp;gt; Digital Signatures... -&amp;gt; Add...&lt;br /&gt;
&lt;br /&gt;
This works also with the legal &amp;quot;signature&amp;quot; certificate&lt;br /&gt;
====Signing in LibreOffice====&lt;br /&gt;
[http://test.eid.belgium.be/faq/faq_fr.htm#Comment_signer_un_document_dans_LibreOffice_.3F Official instructions (in French)]&lt;br /&gt;
&lt;br /&gt;
====Signing in Acrobat Reader====&lt;br /&gt;
acroread can deals with PKCS#11 modules...&lt;br /&gt;
 Document -&amp;gt; Security Settings -&amp;gt; Digital IDs -&amp;gt; PKCS#11 -&amp;gt; Attach module -&amp;gt; &lt;br /&gt;
 /usr/lib/libbeidpkcs11.so         (apparently worked only with v3.5)&lt;br /&gt;
 do not work with acroread 9.5.1 but work with acroread 9.5.4 &lt;br /&gt;
&lt;br /&gt;
You can use https://signbox.eidcompany.be/ (no more service ...) to create a pdf to be signed.&lt;br /&gt;
&amp;lt;br&amp;gt;Seems to work but I still find strange it prompts me twice for the PIN, once in the Acrobat interface (password) and once with the virtual pad of the beid pkcs11 library.&lt;br /&gt;
&lt;br /&gt;
you can use this one https://sign.belgium.be/ it sent you back a Zip file with the pdf and a signature file, not realy convenient :( ...)&lt;br /&gt;
&lt;br /&gt;
Old stuff: see also https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/EidForums/ForumEidCards0068?t=2008-04-04T18:04:26Z and try with http://itext.ugent.be/articles/eid-pdf/&lt;br /&gt;
&lt;br /&gt;
==Linux: Government Middleware v3.5==&lt;br /&gt;
Why upgrading?&lt;br /&gt;
&lt;br /&gt;
Among other things because with a recent eID you could face an error of beidgui about invalid root certificate, see [http://eid.belgium.be/fr/besoin_d_aide/QuickFix/QuickFix_standaard_antwoorden/situatie8.jsp here] and [there http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=385735]&lt;br /&gt;
===Installation===&lt;br /&gt;
Here are some note of a quick run around the new release 3.5&lt;br /&gt;
&amp;lt;br&amp;gt;The middleware was released among other for &amp;quot;Debian Etch&amp;quot;, not bad...&lt;br /&gt;
&amp;lt;br&amp;gt;Well actually the middleware comes with an ugly install.sh script doing stuff like erasing old beidlib files, appending blindly stuff in /etc/ld.conf etc&lt;br /&gt;
&lt;br /&gt;
As I&#039;m not running etch I had to help it a bit:&lt;br /&gt;
&amp;lt;br&amp;gt;libxerces27 is only in etch, but can be installed smoothly on lenny if you apt-get install its own dependency to libicu36&lt;br /&gt;
&amp;lt;br&amp;gt;So now I could try their new toys...&lt;br /&gt;
&lt;br /&gt;
About the GUI:&lt;br /&gt;
*The beidgui is now kind of applet in the taskbar popping up gently your picture when you insert your card.&lt;br /&gt;
*The detailed view provides also a parsing of the ATR, which is much nicer than having to dig into the (outdated) spec docs.&lt;br /&gt;
&lt;br /&gt;
About the beidlib:&lt;br /&gt;
*privacy proxy&amp;quot;: now every time an application wants to read the card there is a Qt popup asking for confirmation and showing the full path of that application. Nice but what for non X systems?&lt;br /&gt;
*PIN prompt: exists also with virtual keypad flavor.&lt;br /&gt;
*BUG?? On my system every time an application requests an operation with PIN it takes 2secs @ 100% CPU to popup  :-( &lt;br /&gt;
&lt;br /&gt;
About the SDK:&lt;br /&gt;
* I could try all C++ examples, didn&#039;t try Java (allergy to that caffeine probably)&lt;br /&gt;
Little quirk to be able to compile the legal signature example:&lt;br /&gt;
 samples/sign_p11/C++/Makefile:&lt;br /&gt;
 -CXXFLAGS      = -O2 -g&lt;br /&gt;
 +CXXFLAGS      = -O2 -g -ldl&lt;br /&gt;
The read_eid and the get_exception are apparently featuring code to read also the SIS card.&lt;br /&gt;
&amp;lt;br&amp;gt;I tried but I got a BEID_Exception (code = e1d00300) which means from eidErrors.h:&lt;br /&gt;
 /** Error communicating with the card */&lt;br /&gt;
 #define EIDMW_ERR_CARD_COMM            0xe1d00300&lt;br /&gt;
You need a reader such as ACR38 which can read memory cards. Even the OmniKey5321 which supports 3-wire protocol seems to not be usable with the middleware to read a SIS card :-(&lt;br /&gt;
===Getting the old lib running too===&lt;br /&gt;
So the barbarian ./install.sh seemed to have deleted the following:&lt;br /&gt;
* beid-tools:&lt;br /&gt;
**/usr/bin/beidcrld&lt;br /&gt;
**/usr/bin/beidpcscd&lt;br /&gt;
*libbeidlibopensc2:&lt;br /&gt;
**/usr/lib/libbeidpkcs11.so.2.1.0&lt;br /&gt;
*libbeidlibopensc2-dev:&lt;br /&gt;
**/usr/include/beid/opensc/*&lt;br /&gt;
Some tools are still working (pcsc_scan, opensc-explorer, beidgui (v2.1), beid-tool&lt;br /&gt;
&amp;lt;br&amp;gt;But some fail: Firefox pkcs11 module, beid-pkcs11-tool&lt;br /&gt;
&lt;br /&gt;
My solution: reinstalling libbeidlibopensc2_2.6.0-6_i386.deb&lt;br /&gt;
&amp;lt;br&amp;gt;It fixed the problem and Firefox is actually using pkcs11 lib of middleware3.5&lt;br /&gt;
&lt;br /&gt;
==Linux: Government Middleware v3.5.x on 64-bit Debian==&lt;br /&gt;
===Installation (libs &amp;amp; Mozilla plugin, manually)===&lt;br /&gt;
I had problems when trying to get the middleware running on my new 64-bit laptop because the binary &amp;amp; libraries available at http://eid.belgium.be are only for 32-bit OS.&lt;br /&gt;
&lt;br /&gt;
My solution was to compile it from code.google.com but it was not that easy because it required a libtool version newer than what was in Debian, so I did (not very clean I agree):&lt;br /&gt;
 sudo apt-get install automake automake1.9-&lt;br /&gt;
 wget ftp://ftp.gnu.org/gnu/libtool/libtool-2.2.10.tar.gz&lt;br /&gt;
 ./bootstrap &lt;br /&gt;
 ./configure &lt;br /&gt;
 make&lt;br /&gt;
 sudo apt-get remove libtool &lt;br /&gt;
 sudo make install&lt;br /&gt;
 sudo cp /usr/local/share/aclocal/* /usr/share/aclocal&lt;br /&gt;
 sudo cp -a /usr/local/share/libtool/config /usr/share/libtool&lt;br /&gt;
Then the middleware code:&lt;br /&gt;
 svn checkout http://eid-mw.googlecode.com/svn/trunk/ eid-mw-read-only&lt;br /&gt;
 # Edit configure.ac -&amp;gt; openssl v0.9.8 ok otherwise it&#039;ll claim for openssl v1.0.0&lt;br /&gt;
 ./bootstrap.sh&lt;br /&gt;
 ./configure &lt;br /&gt;
 make&lt;br /&gt;
 sudo apt-get remove libbeid2 libbeidlibopensc2 beid-tools beidgui  &lt;br /&gt;
 sudo make install&lt;br /&gt;
Middleware works with e.g. Firefox but when prompted for a PIN the virtual keyboard was blank, no image of the numbers on the buttons.&lt;br /&gt;
&lt;br /&gt;
===Installation (via Debian unstable)===&lt;br /&gt;
&#039;&#039;&#039;UPDATE&#039;&#039;&#039;: At the time of writing, middleware v3.5.2 is available in Debian unstable&lt;br /&gt;
====beidgui====&lt;br /&gt;
 sudo aptitude install -t unstable beidgui&lt;br /&gt;
Seems to work except that it doesn&#039;t load my certificates, the tab is just empty&lt;br /&gt;
====beid-mozilla-plugin====&lt;br /&gt;
 sudo aptitude install -t unstable beid-mozilla-plugin&lt;br /&gt;
 Edit &amp;gt; Preferences &amp;gt; Advanced &amp;gt; Encryption &amp;gt; Security Devices &amp;gt; Load &amp;gt; Browse &amp;gt; /usr/lib/libbeidpkcs11.so.3&lt;br /&gt;
Note that apparently the card must be inserted in the reader before you launch Firefox...&lt;br /&gt;
&lt;br /&gt;
There is also a Firefox add-on: [https://addons.mozilla.org/fr/firefox/addon/51744/ eID Belgique  1.0.7], not sure what it&#039;s useful for, apparently it&#039;s meant to ease installation of the middleware &amp;amp; expects plugin to be in /usr/local/lib/libbeidpcks11.so so if you installed /usr/lib/libbeidpkcs11.so.3 in Firefox as stated above you don&#039;t need this plugin.&lt;br /&gt;
&lt;br /&gt;
====beid-tools====&lt;br /&gt;
 sudo aptitude install -t unstable beid-tools&lt;br /&gt;
At first I had an error about undefined symbol because I had still my manual install libraries in /usr/local -&amp;gt; rm /usr/local/bin/beid* /usr/local/lib/*beid* /usr/local/lib/libcard*&lt;br /&gt;
&lt;br /&gt;
==Linux: Government Middleware v4.0.4==&lt;br /&gt;
Some certificate cleaning in Firefox first, cf [http://irisbox.irisnet.be/vip/portal/FireFox.html this page]:&lt;br /&gt;
* Edit / Preferences / Advanced / Encryption / View Certificates / Authorities&lt;br /&gt;
** Delete Global Sign nv-sa / Belgium Root CA2&lt;br /&gt;
** Mmm I did it but it went back, so not sure if it&#039;s needed... and Irisbox fails with eID while other sites work...&lt;br /&gt;
Installing middleware, see [http://eid.belgium.be/en/using_your_eid/installing_the_eid_software/linux/ this page]&lt;br /&gt;
 sudo apt-get remove --purge beid*&lt;br /&gt;
 wget http://eid.belgium.be/fr/binaries/eid-mw_4%2E0%2E4r1253_amd64_tcm226-178472.deb&lt;br /&gt;
 sudo dpkg -i eid-mw_4.0.4r1253_amd64_tcm226-178472.deb&lt;br /&gt;
 wget http://eid.belgium.be/fr/binaries/eid-viewer_4%2E0%2E4r146_amd64_tcm226-178482.deb&lt;br /&gt;
 sudo dpkg -i eid-viewer_4.0.4r146_amd64_tcm226-178482.deb&lt;br /&gt;
For Chromium, see https://code.google.com/p/eid-mw/wiki/ChromeLinux&lt;br /&gt;
 cd&lt;br /&gt;
 modutil -dbdir sql:.pki/nssdb/ -add &amp;quot;Belgium eID&amp;quot; -libfile /usr/lib/libbeidpkcs11.so&lt;br /&gt;
 # check if the library was successfully added&lt;br /&gt;
 modutil -dbdir sql:.pki/nssdb/ -list&lt;br /&gt;
&amp;lt;br&amp;gt;Test it:&lt;br /&gt;
 eid-viewer&lt;br /&gt;
Questions?&lt;br /&gt;
* http://eid.belgium.be/en/using_your_eid/&lt;br /&gt;
* http://test.eid.belgium.be/&lt;br /&gt;
* http://test.eid.belgium.be/faq/faq_fr.htm or http://test.eid.belgium.be/faq/faq_nl.htm&lt;br /&gt;
Untrusted certificate when visiting gov site? see [http://eid.belgium.be/en/using_your_eid/need_help/problemen_met_de_installatie/ this page]&lt;br /&gt;
* Edit / Preferences / Advanced / Encryption / View Certificates / Authorities&lt;br /&gt;
** Edit trust of Belgium Root CA2 / Belgium Root CA2 -&amp;gt; trust for all 3 purposes&lt;br /&gt;
Notes:&lt;br /&gt;
* pcsc needs to run when launching ff, but card doesn&#039;t need to be inserted in advance&lt;br /&gt;
&lt;br /&gt;
==Linux: OpenSC Middleware==&lt;br /&gt;
===Installation===&lt;br /&gt;
belpic, the Belgian middleware, is a modified version of OpenSC, let&#039;s try the plain OpenSC:&lt;br /&gt;
 apt-get install opensc&lt;br /&gt;
=&amp;gt; file:///usr/share/doc/opensc/BelgianEid.html&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;OpenSC 0.10.* will include support for the Belgian eID card, except for legally binding signatures (with the so-called Signature key) as this requires a GUI, which is not yet available/implemented. Till that new release please use the &amp;quot;belpic&amp;quot; software available from the belgian state.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Note that you&#039;ve to stop the filter daemon (beidpcscd) first&lt;br /&gt;
===cardos-info===&lt;br /&gt;
Returns the ATR&lt;br /&gt;
 $ cardos-info &lt;br /&gt;
 3b:98:13:40:0a:a5:03:01:01:01:ad:13:11&lt;br /&gt;
 Received (SW1=0x6D, SW2=0x00)&lt;br /&gt;
&lt;br /&gt;
===opensc-tool===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ opensc-tool -a -v # with debug=1 in /etc/opensc/opensc.conf&lt;br /&gt;
[opensc-tool] ctx.c:705:sc_context_create: ===================================&lt;br /&gt;
[opensc-tool] ctx.c:706:sc_context_create: opensc version: 0.11.4&lt;br /&gt;
[opensc-tool] sc.c:196:sc_detect_card_presence: called&lt;br /&gt;
[opensc-tool] sc.c:201:sc_detect_card_presence: returning with: 1&lt;br /&gt;
Connecting to card in reader iDream ID-SMID01 00 00...&lt;br /&gt;
[opensc-tool] card.c:110:sc_connect_card: called&lt;br /&gt;
[opensc-tool] reader-pcsc.c:542:pcsc_connect: After connect protocol = 1&lt;br /&gt;
[opensc-tool] reader-pcsc.c:561:pcsc_connect: Requesting reader features ... &lt;br /&gt;
[opensc-tool] card-belpic.c:988:belpic_init: Belpic V1.4&lt;br /&gt;
[opensc-tool] card-belpic.c:995:belpic_init: &lt;br /&gt;
[opensc-tool] card.c:221:sc_connect_card: card info: Belpic cards, 12002, 0x0&lt;br /&gt;
[opensc-tool] card.c:222:sc_connect_card: returning with: 0&lt;br /&gt;
Using card driver Belpic cards.&lt;br /&gt;
Card ATR:&lt;br /&gt;
3B 98 13 40 0A A5 03 01 01 01 AD 13 11 ;..@.........&lt;br /&gt;
[opensc-tool] card.c:236:sc_disconnect_card: called&lt;br /&gt;
[opensc-tool] card.c:251:sc_disconnect_card: returning with: 0&lt;br /&gt;
[opensc-tool] ctx.c:738:sc_release_context: called&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From the ATR:&lt;br /&gt;
* Component code: A5&lt;br /&gt;
* OS number: 03&lt;br /&gt;
* OS version: 01&lt;br /&gt;
* Softmask number: 01&lt;br /&gt;
* Softmask version: 01&lt;br /&gt;
* Applet version: 1.1&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ opensc-tool -n      &lt;br /&gt;
Belpic cards&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ opensc-tool -f&lt;br /&gt;
3f00 type:  DF, size: 65535&lt;br /&gt;
select[N/A] lock[N/A] delete[N/A] create[N/A] rehab[N/A] inval[N/A] list[N/A] &lt;br /&gt;
[opensc-tool] card.c:343:sc_list_files: returning with: Not supported&lt;br /&gt;
sc_list_files() failed: Not supported&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Reading the address file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ opensc-tool -s 00CADF3005&lt;br /&gt;
Sending: 00 CA DF 30 05 &lt;br /&gt;
Received (SW1=0x6D, SW2=0x00)&lt;br /&gt;
$ opensc-tool -s 00A4080C023F00&lt;br /&gt;
Sending: 00 A4 08 0C 02 3F 00 &lt;br /&gt;
Received (SW1=0x90, SW2=0x00)&lt;br /&gt;
$ opensc-tool -s 00A4080C043F00DF01&lt;br /&gt;
Sending: 00 A4 08 0C 04 3F 00 DF 01 &lt;br /&gt;
Received (SW1=0x90, SW2=0x00)&lt;br /&gt;
$ opensc-tool -s 00A4080C063F00DF014033&lt;br /&gt;
Sending: 00 A4 08 0C 06 3F 00 DF 01 40 33 &lt;br /&gt;
Received (SW1=0x90, SW2=0x00)&lt;br /&gt;
$ opensc-tool -s 00B0000080        &lt;br /&gt;
Sending: 00 B0 00 00 80 &lt;br /&gt;
Received (SW1=0x90, SW2=0x00):&lt;br /&gt;
01 1E 41 76 65 6E 75 65 20 64 65 20 6C 61 20 43 ..Avenue de la C&lt;br /&gt;
6F 75 72 6F 6E 6E 65 20 34 31 20 2F 62 30 32 37 ouronne 41 /b027&lt;br /&gt;
02 04 31 30 35 30 03 07 49 78 65 6C 6C 65 73 00 ..1050..Ixelles.&lt;br /&gt;
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
00 00 00 00 00                                  .....&lt;br /&gt;
&lt;br /&gt;
(that one is handled smartly because actually there is a first error 6C75 then a new request 00B0000075)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===opensc-explorer===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ opensc-explorer&lt;br /&gt;
&lt;br /&gt;
#PUK: (max trials: 3, length: 4-12)&lt;br /&gt;
OpenSC [3F00]&amp;gt; verify CHV1 31:31:31:31&lt;br /&gt;
[opensc-explorer] sec.c:201:sc_pin_cmd: returning with: PIN code or key incorrect&lt;br /&gt;
Incorrect code, 2 tries left.&lt;br /&gt;
&lt;br /&gt;
OpenSC [3F00]&amp;gt; verify CHV1 31:32:33:34&lt;br /&gt;
Code correct.&lt;br /&gt;
&lt;br /&gt;
#PUK: (max trials: 12, length: 12)&lt;br /&gt;
OpenSC [3F00]&amp;gt; verify CHV3 31:32:33:34&lt;br /&gt;
[opensc-explorer] sec.c:201:sc_pin_cmd: returning with: PIN code or key incorrect&lt;br /&gt;
Incorrect code, 11 tries left.&lt;br /&gt;
&lt;br /&gt;
#PINreset (max trials: 10, length: 12)&lt;br /&gt;
OpenSC [3F00]&amp;gt; verify CHV2 31:32:33:34&lt;br /&gt;
[opensc-explorer] sec.c:201:sc_pin_cmd: returning with: PIN code or key incorrect&lt;br /&gt;
Incorrect code, 9 tries left.&lt;br /&gt;
&lt;br /&gt;
OpenSC [3F00]&amp;gt; random 100&lt;br /&gt;
00000000: 80 8E DD 53 92 0A FB 12 17 7E 77 49 11 D5 3E 93 ...S.....~wI..&amp;gt;.&lt;br /&gt;
00000010: E7 93 CD C1 D8 AB E2 0E 85 34 44 F0 B2 F4 52 8A .........4D...R.&lt;br /&gt;
00000020: FD 0A 34 8F A1 16 2C 91 85 18 77 83 F4 EC 2F DB ..4...,...w.../.&lt;br /&gt;
00000030: 5D 5A A6 F8 4C 61 21 74 B1 C0 E2 4C FF 7B CF BF ]Z..La!t...L.{..&lt;br /&gt;
00000040: 01 A2 06 CB 41 33 EB 75 2E 86 90 A7 E6 FD 0C 8C ....A3.u........&lt;br /&gt;
00000050: BF 12 CD CE 32 EB 40 89 D7 98 39 78 30 86 AF 52 ....2.@...9x0..R&lt;br /&gt;
00000060: 60 E0 F6 C3                                     `...&lt;br /&gt;
&lt;br /&gt;
OpenSC [3F00]&amp;gt; cd df00&lt;br /&gt;
&lt;br /&gt;
OpenSC [3F00/DF00]&amp;gt; get 5035&lt;br /&gt;
Total of 119 bytes read from 5035 and saved to 3F00_DF00_5035.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can also cat the files:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
OpenSC [3F00]&amp;gt; cd df01&lt;br /&gt;
OpenSC [3F00/DF01]&amp;gt; cd 4033&lt;br /&gt;
OpenSC [3F00/DF01/4033]&amp;gt; cat&lt;br /&gt;
00000000: 01 1E 41 76 65 6E 75 65 20 64 65 20 6C 61 20 43 ..Avenue de la C&lt;br /&gt;
00000010: 6F 75 72 6F 6E 6E 65 20 34 31 20 2F 62 30 32 37 ouronne 41 /b027&lt;br /&gt;
00000020: 02 04 31 30 35 30 03 07 49 78 65 6C 6C 65 73 00 ..1050..Ixelles.&lt;br /&gt;
00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
00000070: 00 00 00 00 00                                  .....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The interpretation of the file contents we just extracted can be found in the [[#Specifications|Belgian Electronic Identity Card content]] document&lt;br /&gt;
&amp;lt;br&amp;gt;Here are all the files you can extract:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
3F00_2F00      MF/DIR&lt;br /&gt;
3F00_DF00_5031 MF/Belpic/ODF                 (Object Directory File)&lt;br /&gt;
3F00_DF00_5032 MF/Belpic/TokenInfo&lt;br /&gt;
3F00_DF00_5034 MF/Belpic/AODF                (Authentication Object Directory File)&lt;br /&gt;
3F00_DF00_5035 MF/Belpic/PrKDF               (Private Key Directory File)&lt;br /&gt;
3F00_DF00_5037 MF/Belpic/CDF                 (Certificate Directory File)&lt;br /&gt;
3F00_DF00_5038 MF/Belpic/Cert#2              (auth)&lt;br /&gt;
3F00_DF00_5039 MF/Belpic/Cert#3              (non-rep)&lt;br /&gt;
3F00_DF00_503A MF/Belpic/Cert#4              (CA)&lt;br /&gt;
3F00_DF00_503B MF/Belpic/Cert#6              (Root)&lt;br /&gt;
3F00_DF00_503C MF/Belpic/Cert#8              (RRN)&lt;br /&gt;
3F00_DF01_4031 MF/ID/ID#RN                   (contains also hash of ID#Photo)&lt;br /&gt;
3F00_DF01_4032 MF/ID/SGN#RN                  (signature of ID#RN by RRN)&lt;br /&gt;
3F00_DF01_4033 MF/ID/ID#Address&lt;br /&gt;
3F00_DF01_4034 MF/ID/SGN#Address             (signature of ID#Address|SGN#RN by RRN)&lt;br /&gt;
3F00_DF01_4035 MF/ID/ID#Photo                (140x200 JPEG grayscale)&lt;br /&gt;
3F00_DF01_4038 MF/ID/PuK#7 ID                (CA role Hash SHA-1)&lt;br /&gt;
3F00_DF01_4039 MF/ID/Preferences&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that here we could extract the RRN Cert#8, which was not shown by the usual pkcs#15 tools...&lt;br /&gt;
&amp;lt;br&amp;gt;Note that the Preferences file is 100-byte zeroes, is customisable just with the cardholder PIN but the update_binary command is not supported, so [[#patch|I wrote a patch]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ xview 3F00_DF01_4035 &lt;br /&gt;
3F00_DF01_4035 is a 140x200 JPEG image, color space Grayscale, 1 comp, Huffman coding.&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
So to extract the picture via a simple script:&lt;br /&gt;
 echo -e &amp;quot;cd df01\nget 4035 mypic.jpg&amp;quot;|opensc-explorer&lt;br /&gt;
&lt;br /&gt;
===pkcs11-tool===&lt;br /&gt;
Differences with beid-pkcs11-tool are highlighted between *stars*&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pkcs11-tool --list-slots&lt;br /&gt;
Available slots:&lt;br /&gt;
Slot 0           iDream ID-SMID01 00 00&lt;br /&gt;
  token label:   BELPIC (Basic PIN)&lt;br /&gt;
 *token manuf:   (unknown)*&lt;br /&gt;
  token model:   PKCS #15 SCard&lt;br /&gt;
  token flags:   rng, *login required*, PIN initialized, token initialized&lt;br /&gt;
 *serial num  :  6CFF252C5F190218*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pkcs11-tool --list-objects&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pkcs11-tool --login --list-objects&lt;br /&gt;
Please enter User PIN: &lt;br /&gt;
Private Key Object; RSA &lt;br /&gt;
  label:      Authentication&lt;br /&gt;
  ID:         02&lt;br /&gt;
  Usage:      sign&lt;br /&gt;
Certificate Object, type = X.509 cert&lt;br /&gt;
  label:      Authentication&lt;br /&gt;
  ID:         02&lt;br /&gt;
Public Key Object; RSA 1024 bits&lt;br /&gt;
  label:      Authentication&lt;br /&gt;
  ID:         02&lt;br /&gt;
  Usage:      encrypt, verify&lt;br /&gt;
Private Key Object; RSA &lt;br /&gt;
  label:      Signature&lt;br /&gt;
  ID:         03&lt;br /&gt;
  Usage:      sign&lt;br /&gt;
Certificate Object, type = X.509 cert&lt;br /&gt;
  label:      Signature&lt;br /&gt;
  ID:         03&lt;br /&gt;
Public Key Object; RSA 1024 bits&lt;br /&gt;
  label:      Signature&lt;br /&gt;
  ID:         03&lt;br /&gt;
  Usage:      encrypt, verify&lt;br /&gt;
Certificate Object, type = X.509 cert&lt;br /&gt;
  label:      CA&lt;br /&gt;
  ID:         00&lt;br /&gt;
Public Key Object; RSA 2048 bits&lt;br /&gt;
  label:      CA&lt;br /&gt;
  ID:         04&lt;br /&gt;
  Usage:      encrypt, verify&lt;br /&gt;
Certificate Object, type = X.509 cert&lt;br /&gt;
  label:      Root&lt;br /&gt;
  ID:         00&lt;br /&gt;
Public Key Object; RSA 2048 bits&lt;br /&gt;
  label:      Root&lt;br /&gt;
  ID:         06&lt;br /&gt;
  Usage:      encrypt, verify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Strange, I need to login to extract the objects&lt;br /&gt;
&amp;lt;br&amp;gt;Strange, pubkeys can encrypt but privkey cannot decrypt...&lt;br /&gt;
&amp;lt;br&amp;gt;Strange, both RootCA and CitizenCA certificates have the same id 0&lt;br /&gt;
&amp;lt;br&amp;gt;And what&#039;s the format of those certificates when dumped out? Not DER neither PEM&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pkcs11-tool --login --read-object --id 0 --type cert|xxd&lt;br /&gt;
[...]&lt;br /&gt;
$ pkcs11-tool --login --read-object --id 2 --type pubkey |xxd&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pkcs11-tool --list-mechanisms&lt;br /&gt;
Supported mechanisms:&lt;br /&gt;
  SHA-1, digest&lt;br /&gt;
  *SHA256, digest*&lt;br /&gt;
  *SHA384, digest*&lt;br /&gt;
  *SHA512, digest*&lt;br /&gt;
  MD5, digest&lt;br /&gt;
  RIPEMD160, digest&lt;br /&gt;
  RSA-PKCS, sign, verify, unwrap, *decrypt*&lt;br /&gt;
  SHA1-RSA-PKCS, sign, verify&lt;br /&gt;
  MD5-RSA-PKCS, sign, verify&lt;br /&gt;
  RIPEMD160-RSA-PKCS, sign, verify&lt;br /&gt;
  *RSA-PKCS-KEY-PAIR-GEN, keypairgen*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Extra mechanisms available apparently...&lt;br /&gt;
&amp;lt;br&amp;gt;And they work:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
phil@mercure:~$ echo -n test|pkcs11-tool --hash --mechanism SHA512 |xxd &lt;br /&gt;
0000000: ee26 b0dd 4af7 e749 aa1a 8ee3 c10a e992  .&amp;amp;..J..I........&lt;br /&gt;
0000010: 3f61 8980 772e 473f 8819 a5d4 940e 0db2  ?a..w.G?........&lt;br /&gt;
0000020: 7ac1 85f8 a0e1 d5f8 4f88 bc88 7fd6 7b14  z.......O.....{.&lt;br /&gt;
0000030: 3732 c304 cc5f a9ad 8e6f 57f5 0028 a8ff  72..._...oW..(..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pkcs11-tool --login --test           &lt;br /&gt;
Please enter User PIN: &lt;br /&gt;
C_SeedRandom() and C_GenerateRandom():&lt;br /&gt;
  not implemented&lt;br /&gt;
Digests:&lt;br /&gt;
  all 4 digest functions seem to work&lt;br /&gt;
  MD5: OK&lt;br /&gt;
  SHA-1: OK&lt;br /&gt;
  RIPEMD160: OK&lt;br /&gt;
Signatures (currently only RSA signatures)&lt;br /&gt;
  testing key 0 (Authentication) &lt;br /&gt;
  all 4 signature functions seem to work&lt;br /&gt;
  testing signature mechanisms:&lt;br /&gt;
    RSA-PKCS: OK&lt;br /&gt;
    SHA1-RSA-PKCS: OK&lt;br /&gt;
    MD5-RSA-PKCS: OK&lt;br /&gt;
    RIPEMD160-RSA-PKCS: OK&lt;br /&gt;
  testing key 1 (1024 bits, label=Signature) with 1 signature mechanism&lt;br /&gt;
[opensc-pkcs11] sec.c:67:sc_set_security_env: returning with: Not supported&lt;br /&gt;
error: PKCS11 function C_Sign failed: rv = CKR_FUNCTION_NOT_SUPPORTED (0x54)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===pkcs15-tool===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pkcs15-tool --dump&lt;br /&gt;
PKCS#15 Card [BELPIC]:&lt;br /&gt;
        Version        : 1&lt;br /&gt;
        Serial number  : 1234567890ABCDEF1234567890ABCDEF&lt;br /&gt;
        Manufacturer ID: (unknown)&lt;br /&gt;
        Flags          : PRN generation, EID compliant&lt;br /&gt;
&lt;br /&gt;
PIN [Basic PIN]&lt;br /&gt;
        Com. Flags: 0x3&lt;br /&gt;
        ID        : 01&lt;br /&gt;
        Flags     : [0x30], initialized, needs-padding&lt;br /&gt;
        Length    : min_len:4, max_len:12, stored_len:8&lt;br /&gt;
        Pad char  : 0xFF&lt;br /&gt;
        Reference : 1&lt;br /&gt;
        Type      : bcd&lt;br /&gt;
        Path      : 3f00&lt;br /&gt;
&lt;br /&gt;
Private RSA Key [Authentication]&lt;br /&gt;
        Com. Flags  : 3&lt;br /&gt;
        Usage       : [0x4], sign&lt;br /&gt;
        Access Flags: [0x1D], sensitive, alwaysSensitive, neverExtract, local&lt;br /&gt;
        ModLength   : 1024&lt;br /&gt;
        Key ref     : 130&lt;br /&gt;
        Native      : yes&lt;br /&gt;
        Path        : 3f00df00&lt;br /&gt;
        Auth ID     : 01&lt;br /&gt;
        ID          : 02&lt;br /&gt;
&lt;br /&gt;
Private RSA Key [Signature]&lt;br /&gt;
        Com. Flags  : 3&lt;br /&gt;
        Usage       : [0x200], nonRepudiation&lt;br /&gt;
        Access Flags: [0x1D], sensitive, alwaysSensitive, neverExtract, local&lt;br /&gt;
        ModLength   : 1024&lt;br /&gt;
        Key ref     : 131&lt;br /&gt;
        Native      : yes&lt;br /&gt;
        Path        : 3f00df00&lt;br /&gt;
        Auth ID     : 01&lt;br /&gt;
        ID          : 03&lt;br /&gt;
&lt;br /&gt;
X.509 Certificate [Authentication]&lt;br /&gt;
        Flags    : 3&lt;br /&gt;
        Authority: no&lt;br /&gt;
        Path     : 3f00df005038&lt;br /&gt;
        ID       : 02&lt;br /&gt;
&lt;br /&gt;
X.509 Certificate [Signature]&lt;br /&gt;
        Flags    : 3&lt;br /&gt;
        Authority: no&lt;br /&gt;
        Path     : 3f00df005039&lt;br /&gt;
        ID       : 03&lt;br /&gt;
&lt;br /&gt;
X.509 Certificate [CA]&lt;br /&gt;
        Flags    : 3&lt;br /&gt;
        Authority: yes&lt;br /&gt;
        Path     : 3f00df00503a&lt;br /&gt;
        ID       : 04&lt;br /&gt;
&lt;br /&gt;
X.509 Certificate [Root]&lt;br /&gt;
        Flags    : 3&lt;br /&gt;
        Authority: yes&lt;br /&gt;
        Path     : 3f00df00503b&lt;br /&gt;
        ID       : 06&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&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;
&lt;br /&gt;
===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;
===eidenv===&lt;br /&gt;
Very interesting one...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ eidenv | recode UTF8..&lt;br /&gt;
BELPIC_CARDNUMBER: 123456789012&lt;br /&gt;
BELPIC_CHIPNUMBER: 1234567890ABCDEF1234567890ABCDEF&lt;br /&gt;
BELPIC_VALIDFROM: 20.06.2005&lt;br /&gt;
BELPIC_VALIDTILL: 20.06.2010&lt;br /&gt;
BELPIC_DELIVERINGMUNICIPALITY: Liege&lt;br /&gt;
BELPIC_NATIONALNUMBER: 00310100123&lt;br /&gt;
BELPIC_NAME: Teuwen&lt;br /&gt;
BELPIC_FIRSTNAMES: Philippe Yvon&lt;br /&gt;
BELPIC_INITIAL: F&lt;br /&gt;
BELPIC_NATIONALITY: Belge&lt;br /&gt;
BELPIC_BIRTHLOCATION: Liège&lt;br /&gt;
BELPIC_BIRTHDATE: 31 JAN  1900 (or 2000? ;-)&lt;br /&gt;
BELPIC_SEX: M&lt;br /&gt;
BELPIC_NOBLECONDITION: &lt;br /&gt;
BELPIC_DOCUMENTTYPE: 1&lt;br /&gt;
BELPIC_SPECIALSTATUS: 0&lt;br /&gt;
BELPIC_STREETANDNUMBER: Rue de l&#039;OpenSource 12 /b012&lt;br /&gt;
BELPIC_ZIPCODE: 1050&lt;br /&gt;
BELPIC_MUNICIPALITY: Ixelles&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ eidenv --exec /bin/bash&lt;br /&gt;
$ echo $BELPIC_NAME&lt;br /&gt;
Teuwen&lt;br /&gt;
$ exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But if the filter daemon beidpcscd is running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ eidenv &lt;br /&gt;
[eidenv] reader-pcsc.c:534:pcsc_connect: SCardConnect failed: Sharing violation.&lt;br /&gt;
[eidenv] card.c:228:sc_connect_card: returning with: Generic reader error&lt;br /&gt;
Failed to connect to card: Generic reader error&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I expected to get prompted by the filter but nothing like that&lt;br /&gt;
===patch===&lt;br /&gt;
The middleware is missing the function update_binary() while the card supports it and provides a writable file EF(Preferences) for the cardholder (you need first to login with your PIN)&lt;br /&gt;
&amp;lt;br&amp;gt;So I added it and [http://bugs.debian.org/470637 submitted it in bugreport #470637]&lt;br /&gt;
&amp;lt;br&amp;gt;Demo: how to install Linux on the eID (hum, so to speak...)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ opensc-explorer&lt;br /&gt;
OpenSC Explorer version 0.11.4&lt;br /&gt;
OpenSC [3F00]&amp;gt; cd df01&lt;br /&gt;
OpenSC [3F00/DF01]&amp;gt; verify CHV1 31:32:33:34&lt;br /&gt;
Code correct.&lt;br /&gt;
OpenSC [3F00/DF01]&amp;gt; put 4039 tux.txt&lt;br /&gt;
Total of 100 bytes written.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ opensc-explorer&lt;br /&gt;
OpenSC Explorer version 0.11.4&lt;br /&gt;
OpenSC [3F00]&amp;gt; cd df01&lt;br /&gt;
OpenSC [3F00/DF01]&amp;gt; cd 4039&lt;br /&gt;
OpenSC [3F00/DF01/4039]&amp;gt; cat&lt;br /&gt;
000000: 5B 47 65 6E 5D 0A 4C 47 3D 66 72 00 5F 20 20 20 [Gen].LG=fr._&lt;br /&gt;
000010: 00 00 00 00 00 00 00 00 20 20 20 2E 20 2E 20 20 ........   . .&lt;br /&gt;
000020: 00 00 00 00 00 00 00 00 20 20 20 2F 56 5C 20 20 ........   /V\&lt;br /&gt;
000030: 00 00 00 00 00 00 00 00 20 20 2F 2F 20 5C 5C 20 ........  // \\&lt;br /&gt;
000040: 00 00 00 00 00 00 00 00 20 2F 28 20 20 20 29 5C ........ /(   )\&lt;br /&gt;
000050: 00 00 00 00 00 00 00 00 20 20 5E 60 7E 27 5E 20 ........  ^`~&#039;^&lt;br /&gt;
000060: 00 00 00 00                                     ....&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux: to be sorted...==&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;
cf [[OpenSSH#Patch_for_login_with_eID]]&lt;br /&gt;
&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;
[https://openid.trustbearer.com TrustBearer OpenID] supports the Belgian eID as an authentication token. The service uses a browser add-on which contains a middleware stack that communicates directly with the reader &amp;amp; card. See a demonstration on [http://blog.rootshell.be/2008/04/28/openid-and-belgian-eid/ this blog].&lt;br /&gt;
&lt;br /&gt;
===Cryptonit===&lt;br /&gt;
From [http://www.opentrust.com/content/view/135/142index.en.html News:] OPENTRUST has announced the availability of a new version of Cryptonit. This latest release is fully compatible with the Belgium electronic ID card which when used with Cryptonit enables documents to be digitally signed.&amp;lt;br&amp;gt;[http://sourceforge.net/project/showfiles.php?group_id=110403 download]&lt;br /&gt;
&lt;br /&gt;
Under Debian:&lt;br /&gt;
 apt-get install cryptonit&lt;br /&gt;
 Device-&amp;gt;Load-&amp;gt; /usr/lib/libbeidpkcs11.so&lt;br /&gt;
It works, you can sign files with both certificates.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that the first PIN prompt doesn&#039;t matter, you&#039;ll get prompted directly by the libbeidpkcs11 middleware.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that for repetitive Authentication signings (even after close/reopen cryptonit) it doesn&#039;t prompt me anymore for the next signatures, but well if I want to use the non-repudiation one.&lt;br /&gt;
===Exploring with jcshell===&lt;br /&gt;
You can probably achieve the same with gpshell but I couldn&#039;t get gpshell working properly.&lt;br /&gt;
&lt;br /&gt;
Trying GP211 AID:&lt;br /&gt;
&amp;lt;br&amp;gt;Note that it works on a card from 2010 but on older cards there is no card manager accessible with that AID.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ jcshell&lt;br /&gt;
&lt;br /&gt;
Welcome to NXP JCShell!&lt;br /&gt;
(c) 2012 NXP Semiconductors Germany GmbH&lt;br /&gt;
------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
setting scripts-folder to ./scripts ...&lt;br /&gt;
enabling modes echo and trace...&lt;br /&gt;
- /term pcsc&lt;br /&gt;
--Opening terminal&lt;br /&gt;
&amp;gt; /card -a a0000001510000&lt;br /&gt;
resetCard with timeout: 0 (ms)&lt;br /&gt;
--Waiting for card...&lt;br /&gt;
ATR=3B 98 13 40 0A A5 03 01 01 01 AD 13 11             ;..@.........&lt;br /&gt;
 IOCTL().&lt;br /&gt;
ATR:&lt;br /&gt;
         T = 0&lt;br /&gt;
 =&amp;gt; 00 A4 04 00 09 A0 00 00 01 67 41 30 00 FF          .........gA0..&lt;br /&gt;
 (153838 usec)&lt;br /&gt;
&amp;lt;= 6A 86                                              j.&lt;br /&gt;
Status: Incorrect parameters (P1,P2)&lt;br /&gt;
 =&amp;gt; 00 A4 04 00 07 A0 00 00 01 51 00 00 00             .........Q...&lt;br /&gt;
 (87173 usec)&lt;br /&gt;
&amp;lt;= 6F 18 84 07 A0 00 00 01 51 00 00 A5 0D 9F 6E 06    o.......Q.....n.&lt;br /&gt;
    20 41 61 31 02 02 9F 65 01 FF 90 00                 Aa1...e....&lt;br /&gt;
Status: No Error&lt;br /&gt;
cm&amp;gt; get-cplc&lt;br /&gt;
 =&amp;gt; 80 CA 9F 7F 00                                     .....&lt;br /&gt;
 (80409 usec)&lt;br /&gt;
&amp;lt;= 9F 7F 2A 40 90 66 93 20 41 61 31 02 02 20 3B 18    ..*@.f. Aa1.. ;.&lt;br /&gt;
    0E 05 2A 00 13 19 42 00 00 19 43 00 00 19 44 00    ..*...B...C...D.&lt;br /&gt;
    00 00 00 BA 01 FF FF FF FF FF FF FF FF 90 00       ...............&lt;br /&gt;
Status: No Error&lt;br /&gt;
  IC Fabricator                      : 4090&lt;br /&gt;
  IC Type                            : 6693&lt;br /&gt;
  Operating System ID                : 2041&lt;br /&gt;
  Operating System release date      : 6131 (10.5.2006)&lt;br /&gt;
  Operating System release level     : 0202&lt;br /&gt;
  IC Fabrication Date                : 203B (10.2.20X2)&lt;br /&gt;
  IC Serial Number                   : 180E052A&lt;br /&gt;
  IC Batch Identifier                : 0013&lt;br /&gt;
  IC Module Fabricator               : 1942&lt;br /&gt;
  IC Module Packaging Date           : 0000&lt;br /&gt;
  ICC Manufacturer                   : 1943&lt;br /&gt;
  IC Embedding Date                  : 0000&lt;br /&gt;
  IC Pre-Personalizer                : 1944&lt;br /&gt;
  IC Pre-Perso. Equipment Date       : 0000&lt;br /&gt;
  IC Pre-Perso. Equipment ID         : 0000BA01&lt;br /&gt;
  IC Personalizer                    : FFFF&lt;br /&gt;
  IC Personalization Date            : FFFF&lt;br /&gt;
  IC Perso. Equipment ID             : FFFFFFFF&lt;br /&gt;
cm&amp;gt; get-data 9f7f&lt;br /&gt;
 =&amp;gt; 80 CA 9F 7F 00                                     .....&lt;br /&gt;
 (80339 usec)&lt;br /&gt;
&amp;lt;= 9F 7F 2A 40 90 66 93 20 41 61 31 02 02 20 3B 18    ..*@.f. Aa1.. ;.&lt;br /&gt;
    0E 05 2A 00 13 19 42 00 00 19 43 00 00 19 44 00    ..*...B...C...D.&lt;br /&gt;
    00 00 00 BA 01 FF FF FF FF FF FF FF FF 90 00       ...............&lt;br /&gt;
Status: No Error&lt;br /&gt;
cm&amp;gt; get-data 0066&lt;br /&gt;
 =&amp;gt; 80 CA 00 66 00                                     ...f.&lt;br /&gt;
 (103044 usec)&lt;br /&gt;
&amp;lt;= 66 3F 73 3D 06 07 2A 86 48 86 FC 6B 01 60 0C 06    f?s=..*.H..k.`..&lt;br /&gt;
    0A 2A 86 48 86 FC 6B 02 02 01 01 63 09 06 07 2A    .*.H..k....c...*&lt;br /&gt;
    86 48 86 FC 6B 03 64 0B 06 09 2A 86 48 86 FC 6B    .H..k.d...*.H..k&lt;br /&gt;
    04 01 05 66 0C 06 0A 2B 06 01 04 01 2A 02 6E 01    ...f...+....*.n.&lt;br /&gt;
    02 90 00                                           ...&lt;br /&gt;
Status: No Error&lt;br /&gt;
Global Platform version                : 2.1.1&lt;br /&gt;
Global Platform Secure Channel Protocol: 01 option 05&lt;br /&gt;
Java Card version                      : 2.2&lt;br /&gt;
cm&amp;gt; get-data 0042&lt;br /&gt;
 =&amp;gt; 80 CA 00 42 00                                     ...B.&lt;br /&gt;
 (38576 usec)&lt;br /&gt;
&amp;lt;= 42 06 FF FF FF FF FF FF 90 00                      B.........&lt;br /&gt;
Status: No Error&lt;br /&gt;
cm&amp;gt; get-data 0045&lt;br /&gt;
 =&amp;gt; 80 CA 00 45 00                                     ...E.&lt;br /&gt;
 (40849 usec)&lt;br /&gt;
&amp;lt;= 45 08 FF FF FF FF FF FF FF FF 90 00                E...........&lt;br /&gt;
Status: No Error&lt;br /&gt;
cm&amp;gt; get-data 00e0&lt;br /&gt;
 =&amp;gt; 80 CA 00 E0 00                                     .....&lt;br /&gt;
 (74442 usec)&lt;br /&gt;
&amp;lt;= E0 12 C0 04 01 01 80 10 C0 04 02 01 80 10 C0 04    ................&lt;br /&gt;
    03 01 80 10 90 00                                  ......&lt;br /&gt;
Status: No Error&lt;br /&gt;
Key information:&lt;br /&gt;
  Key ID          :   1&lt;br /&gt;
  Key version     :   1&lt;br /&gt;
  Key component 1 :&lt;br /&gt;
    Type          :   DES&lt;br /&gt;
    Length        :   16 bytes&lt;br /&gt;
Key information:&lt;br /&gt;
  Key ID          :   2&lt;br /&gt;
  Key version     :   1&lt;br /&gt;
  Key component 1 :&lt;br /&gt;
    Type          :   DES&lt;br /&gt;
    Length        :   16 bytes&lt;br /&gt;
Key information:&lt;br /&gt;
  Key ID          :   3&lt;br /&gt;
  Key version     :   1&lt;br /&gt;
  Key component 1 :&lt;br /&gt;
    Type          :   DES&lt;br /&gt;
    Length        :   16 bytes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux: TODO==&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;See also file:///usr/share/doc/opensc/PamModules.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;
See also file:///usr/share/doc/opensc/QuickStart.html&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;
&amp;lt;br&amp;gt;and https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/EidForums/ForumEidCardReverseProxy0004&lt;br /&gt;
&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;
&amp;lt;br&amp;gt;&#039;&#039;&#039;UPDATE&#039;&#039;&#039; openvpn 2.1~rc7-1 is available soon on Debian&lt;br /&gt;
&lt;br /&gt;
===TODO: Misc===&lt;br /&gt;
* [http://opensignature.sourceforge.net/english.php OpenSignature] targeted for Italian eID&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;
* JAVA&lt;br /&gt;
** beidlib.jar: BEIDCard.html and Test.java&lt;br /&gt;
** http://homes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/JavaEidSampleCodeTOC&lt;br /&gt;
* Novell version in C#...&lt;br /&gt;
** I could compile but still runtime errors&lt;br /&gt;
* http://www.law.kuleuven.be/icri/publications/954eIDPDFSignatures.pdf.pdf and [http://www.law.kuleuven.be/icri/all_pubs.php?action=pubs_topic&amp;amp;id=2&amp;amp;where= other papers]&lt;br /&gt;
* http://www.tonywhitmore.co.uk/cgi-local/wiki.pl?UsefulNotes/SmartCards&lt;br /&gt;
* WPA?? file:///usr/share/doc/opensc/WPA.html&lt;br /&gt;
* https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Eid/EidForum Danny opened some forums on eID, a lot to read probably ;-)&lt;br /&gt;
** [https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/EidForums/ForumEidCards0031  What about the preferences file?]&lt;br /&gt;
* http://javadoc.iaik.tugraz.at/iaik_jce/current/index.html&lt;br /&gt;
* http://www.uvcw.be/e-communes/eid &amp;amp; http://www.uvcw.be/articles/3,90,39,39,1398.htm&lt;br /&gt;
* http://www.disinstitute.be/&lt;br /&gt;
* http://www.eidating.be/&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;http://www.belgium.be/eportal/application?pageid=contentPage&amp;amp;docId=30000 .. 45000?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* http://homes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/AppletEidCardsUtilityTOC&lt;br /&gt;
** the applet loads but nothing happens when trying to see the content of the card :-(&lt;br /&gt;
* http://www.linux.com/feature/131527&lt;br /&gt;
* a [https://code.google.com/p/eid-javascript-lib/ JavaScript file] to be used with the applet from the eID middleware, making it easier to retrieve data out (and format the data) of eID- and SIS cards using the applet from the eID middleware.&lt;br /&gt;
* http://doc.ubuntu-fr.org/tutoriel/utiliser_carte_identite_electronique_belge&lt;/div&gt;</summary>
		<author><name>Dorian</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Arduino_PDU&amp;diff=6962</id>
		<title>Arduino PDU</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Arduino_PDU&amp;diff=6962"/>
		<updated>2011-02-11T15:30:29Z</updated>

		<summary type="html">&lt;p&gt;Dorian: /* What do we need ? / cahier des charges */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PDU, APC or Server control unit or wathever you want ;-)&lt;br /&gt;
&lt;br /&gt;
APC stand in the minds of IT engineer as system witch control the power supply of servers&lt;br /&gt;
-&amp;gt; if you want to remotely shut down or reboot a server, You&#039;ll sure use a APC or PDU...&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;problem&amp;quot; with this system, this is a very hard way to shut down a server.&lt;br /&gt;
it could be better to put on the power or reset button ?&lt;br /&gt;
&lt;br /&gt;
Yes you get the idea, a system able to put on the power button (remotely off course)&lt;br /&gt;
&lt;br /&gt;
=== What do we need ? / cahier des charges ===&lt;br /&gt;
* communication ethernet&lt;br /&gt;
** pour la config&lt;br /&gt;
** pour les ordres de commande&lt;br /&gt;
** simple telnet suffit (on sera obligatoirement sur reseaux prive)&lt;br /&gt;
* communication serie avec le system&lt;br /&gt;
** pour la config (IP) uniquement ?&lt;br /&gt;
** est-il vraiment utile de pouvoir commander via le port serie &lt;br /&gt;
(vu qu&#039;il ne sera raccorder a priopri qu&#039;a une seule machine ...)&lt;br /&gt;
* idealement capable de commander plusieur serveur (par commande on entend &#039;&#039;apuiller&#039;&#039; sur le BP power ou reset) &lt;br /&gt;
* pouvoir mettre une etiquette sur chaque serveur (evite de se tromper de serveur)&lt;br /&gt;
* sans alim ou si celui si est dans le choux, les serveurs ne doivent pas se couper/rebooter ...&lt;br /&gt;
&lt;br /&gt;
==== Idee dingue ou pas ? ====&lt;br /&gt;
* &#039;lecture&#039; des diodes power et HDD ou autre ?&lt;br /&gt;
* ssh &lt;br /&gt;
** bon ca on n&#039;y pense meme pas ! :-p&lt;br /&gt;
* Extensionalisable sans trop de frais&lt;br /&gt;
** point de vue interface ethernet&lt;br /&gt;
*** maintenant vu le faible cout :/&lt;/div&gt;</summary>
		<author><name>Dorian</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Arduino_PDU&amp;diff=6961</id>
		<title>Arduino PDU</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Arduino_PDU&amp;diff=6961"/>
		<updated>2011-02-11T15:19:14Z</updated>

		<summary type="html">&lt;p&gt;Dorian: /* What do we need ? / cahier des charges */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PDU, APC or Server control unit or wathever you want ;-)&lt;br /&gt;
&lt;br /&gt;
APC stand in the minds of IT engineer as system witch control the power supply of servers&lt;br /&gt;
-&amp;gt; if you want to remotely shut down or reboot a server, You&#039;ll sure use a APC or PDU...&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;problem&amp;quot; with this system, this is a very hard way to shut down a server.&lt;br /&gt;
it could be better to put on the power or reset button ?&lt;br /&gt;
&lt;br /&gt;
Yes you get the idea, a system able to put on the power button (remotely off course)&lt;br /&gt;
&lt;br /&gt;
=== What do we need ? / cahier des charges ===&lt;br /&gt;
* communication ethernet&lt;br /&gt;
** pour la config&lt;br /&gt;
** pour les ordres de commande&lt;br /&gt;
** simple telnet suffit (on sera obligatoirement sur reseaux prive)&lt;br /&gt;
* communication serie avec le system&lt;br /&gt;
** pour la config (IP) uniquement ?&lt;br /&gt;
** est-il vraiment utile de pouvoir commander via le port serie &lt;br /&gt;
(vu qu&#039;il ne sera raccorder a priopri qu&#039;a une seule machine ...)&lt;br /&gt;
* idealement capable de commander plusieur serveur (par commande on entend &#039;&#039;apuiller&#039;&#039; sur le BP power ou reset) &lt;br /&gt;
* pouvoir mettre une etiquette sur chaque serveur (evite de se tromper de serveur)&lt;br /&gt;
* sans alim ou si celui si est dans le choux, les serveurs ne doivent pas se couper/rebooter ...&lt;br /&gt;
&lt;br /&gt;
==== Idee dingue ou pas ? ====&lt;br /&gt;
* &#039;lecture&#039; des diodes power et HDD ou autre ?&lt;br /&gt;
* ssh &lt;br /&gt;
** bon ca on n&#039;y pense meme pas ! :-p&lt;/div&gt;</summary>
		<author><name>Dorian</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Arduino_PDU&amp;diff=6960</id>
		<title>Arduino PDU</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Arduino_PDU&amp;diff=6960"/>
		<updated>2011-02-11T15:16:16Z</updated>

		<summary type="html">&lt;p&gt;Dorian: /* What do we need ? / cahier des charges */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PDU, APC or Server control unit or wathever you want ;-)&lt;br /&gt;
&lt;br /&gt;
APC stand in the minds of IT engineer as system witch control the power supply of servers&lt;br /&gt;
-&amp;gt; if you want to remotely shut down or reboot a server, You&#039;ll sure use a APC or PDU...&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;problem&amp;quot; with this system, this is a very hard way to shut down a server.&lt;br /&gt;
it could be better to put on the power or reset button ?&lt;br /&gt;
&lt;br /&gt;
Yes you get the idea, a system able to put on the power button (remotely off course)&lt;br /&gt;
&lt;br /&gt;
=== What do we need ? / cahier des charges ===&lt;br /&gt;
* communication ethernet&lt;br /&gt;
** pour la config&lt;br /&gt;
** pour les ordres de commande&lt;br /&gt;
** simple telnet suffit (on sera obligatoirement sur reseaux prive)&lt;br /&gt;
* communication serie avec le system&lt;br /&gt;
** pour la config (IP) uniquement ?&lt;br /&gt;
** est-il vraiment utile de pouvoir commander via le port serie &lt;br /&gt;
(vu qu&#039;il ne sera raccorder a priopri qu&#039;a une seule machine ...)&lt;br /&gt;
* idealement capable de commander plusieur serveur (par commande on entend &#039;&#039;apuiller&#039;&#039; sur le BP power ou reset) &lt;br /&gt;
* pouvoir mettre une etiquette sur chaque serveur (evite de se tromper de serveur)&lt;br /&gt;
* sans alim ou si celui si est dans le choux, les serveurs ne doivent pas se couper/rebooter ...&lt;/div&gt;</summary>
		<author><name>Dorian</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Arduino_PDU&amp;diff=6959</id>
		<title>Arduino PDU</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Arduino_PDU&amp;diff=6959"/>
		<updated>2011-02-11T15:15:08Z</updated>

		<summary type="html">&lt;p&gt;Dorian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PDU, APC or Server control unit or wathever you want ;-)&lt;br /&gt;
&lt;br /&gt;
APC stand in the minds of IT engineer as system witch control the power supply of servers&lt;br /&gt;
-&amp;gt; if you want to remotely shut down or reboot a server, You&#039;ll sure use a APC or PDU...&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;problem&amp;quot; with this system, this is a very hard way to shut down a server.&lt;br /&gt;
it could be better to put on the power or reset button ?&lt;br /&gt;
&lt;br /&gt;
Yes you get the idea, a system able to put on the power button (remotely off course)&lt;br /&gt;
&lt;br /&gt;
=== What do we need ? / cahier des charges ===&lt;br /&gt;
* communication ethernet&lt;br /&gt;
** pour la config&lt;br /&gt;
** pour les ordres de commande&lt;br /&gt;
* communication serie avec le system&lt;br /&gt;
** pour la config (IP) uniquement ?&lt;br /&gt;
** est-il vraiment utile de pouvoir commander via le port serie &lt;br /&gt;
(vu qu&#039;il ne sera raccorder a priopri qu&#039;a une seule machine ...)&lt;br /&gt;
* idealement capable de commander plusieur serveur (par commande on entend &#039;&#039;apuiller&#039;&#039; sur le BP power ou reset) &lt;br /&gt;
* pouvoir mettre une etiquette sur chaque serveur (evite de se tromper de serveur)&lt;br /&gt;
* sans alim ou si celui si est dans le choux, les serveurs ne doivent pas se couper/rebooter ...&lt;/div&gt;</summary>
		<author><name>Dorian</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Arduino_PDU&amp;diff=6958</id>
		<title>Arduino PDU</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Arduino_PDU&amp;diff=6958"/>
		<updated>2011-02-11T15:06:36Z</updated>

		<summary type="html">&lt;p&gt;Dorian: Created page with &amp;quot;PDU, APC or Server control unit or wathever you want ;-)  APC stand in the minds of IT engineer as system witch control the power supply of servers -&amp;gt; if you want to remotely shu…&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PDU, APC or Server control unit or wathever you want ;-)&lt;br /&gt;
&lt;br /&gt;
APC stand in the minds of IT engineer as system witch control the power supply of servers&lt;br /&gt;
-&amp;gt; if you want to remotely shut down or reboot a server, You&#039;ll sure use a APC or PDU...&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;problem&#039;&#039;&#039; with this system, this is a very hard way to shut down a server.&lt;br /&gt;
it could be better to put on the power or reset button ?&lt;br /&gt;
&lt;br /&gt;
Yes you get the idea, a system&lt;/div&gt;</summary>
		<author><name>Dorian</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Arduino&amp;diff=6957</id>
		<title>Arduino</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Arduino&amp;diff=6957"/>
		<updated>2011-02-11T14:56:54Z</updated>

		<summary type="html">&lt;p&gt;Dorian: /* Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So after the [http://www.brucon.org/index.php/Workshops#Arduino:_how_we_made_the_beerduino Arduino workshop] at BruCON 2009 (pics [http://gallery.yobi.be/v/divers/evenements/brucon2009/IMG_9977.JPG.html here]), I was seduced by this little development board.&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Arduino Arduino on Wikipedia]&lt;br /&gt;
===boards &amp;amp; clones===&lt;br /&gt;
====[http://arduino.cc/en/Main/ArduinoBoardDuemilanove Duemilanove] (SmartProjects)====&lt;br /&gt;
The Duemilanove automatically selects the appropriate power supply (USB or external power), eliminating the need for the power selection jumper found on previous boards. It also adds an easiest to cut trace for disabling the auto-reset, along with a solder jumper for re-enabling it.&lt;br /&gt;
&lt;br /&gt;
based on the ATmega168, latest versions are based on ATmega328p&lt;br /&gt;
&lt;br /&gt;
Clones:&lt;br /&gt;
* Roboduino&lt;br /&gt;
* [http://spiffie.org/kits/freeduino2009/ Freeduino 2009], an (almost) all through hole remake&lt;br /&gt;
* [http://www.ge-th.com/product.asp?id=118 Chinduino Duemilanove168-20PU] or [http://www.ge-th.com/product.asp?id=119 Duemilanove328-20PU]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Make it better&amp;quot; clones:&lt;br /&gt;
* [http://www.freetronics.com/products/twentyten TwentyTen] by Freetronics. Nice small enhancements, but more expensive than the other clones...&lt;br /&gt;
&lt;br /&gt;
====[http://arduino.cc/en/Main/ArduinoBoardDecimilia Decimilia] (SmartProjects)====&lt;br /&gt;
Version before Duemilanove, with a jumper to select the power supply (USB or external power)&lt;br /&gt;
&lt;br /&gt;
based on the Atmega168, can be upgraded with a ATmega328&lt;br /&gt;
&lt;br /&gt;
Clones:&lt;br /&gt;
* [http://www.nuelectronics.com/estore/index.php?main_page=product_info&amp;amp;cPath=1&amp;amp;products_id=1 Freeduino V1.16 Board]&lt;br /&gt;
* Freeduino MaxSerial&lt;br /&gt;
* HACEduino &amp;quot;2009&amp;quot;&lt;br /&gt;
* Fino168 USB Board&lt;br /&gt;
** with a DIP switch to disable auto-reset and D13 LED&lt;br /&gt;
* Duino168 Serial Board&lt;br /&gt;
** with a DIP switch to disable auto-reset and D13 LED&lt;br /&gt;
* Duino328 Serial Board&lt;br /&gt;
** with a DIP switch to disable auto-reset and D13 LED&lt;br /&gt;
* [http://www.makershed.com/ProductDetails.asp?ProductCode=MKSEEED2&amp;amp;ampClick=19209 Seeeduino]&lt;br /&gt;
&lt;br /&gt;
====[http://arduino.cc/en/Main/ArduinoBoardLilypad Lilypad] (SparkFun)====&lt;br /&gt;
based on the ATmega168V on v03 (the low-power version of the ATmega168) or the ATmega328V on v04&lt;br /&gt;
&lt;br /&gt;
====[http://arduino.cc/en/Main/ArduinoBoardPro Pro] (SparkFun)====&lt;br /&gt;
based on the ATmega168 or ATmega328. The Pro comes in both 3.3V / 8 MHz and 5V / 16 MHz versions. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a battery power jack, a power switch, a reset button, and holes for mounting a power jack, an ICSP header, and pin headers. A six pin header can be connected to an FTDI cable or Sparkfun breakout board to provide USB power and communication to the board.&lt;br /&gt;
&lt;br /&gt;
The Arduino Pro is intended for semi-permanent installation in objects or exhibitions. The board comes without pre-mounted headers, allowing the use of various types of connectors or direct soldering of wires. The pin layout is compatible with Arduino shields. The 3.3V versions of the Pro can be powered with a battery.&lt;br /&gt;
&lt;br /&gt;
Take care that the embedded power regulator is smaller and outputs max 150mA&lt;br /&gt;
&lt;br /&gt;
====[http://arduino.cc/en/Main/ArduinoBoardProMini Pro Mini] (SparkFun)====&lt;br /&gt;
based on the ATmega168. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, an on-board resonator, a reset button, and holes for mounting pin headers. A six pin header can be connected to an FTDI cable or Sparkfun breakout board to provide USB power and communication to the board.&lt;br /&gt;
&lt;br /&gt;
The Arduino Pro Mini is intended for semi-permanent installation in objects or exhibitions. The board comes without pre-mounted headers, allowing the use of various types of connectors or direct soldering of wires. The pin layout is compatible with the Arduino Mini.&lt;br /&gt;
&lt;br /&gt;
There are two version of the Pro Mini. One runs at 3.3V and 8 MHz, the other at 5V and 16 MHz.&lt;br /&gt;
&lt;br /&gt;
====[http://www.arduino.cc/en/Main/ArduinoBoardNano Nano] (Gravitech)====&lt;br /&gt;
small, complete, and breadboard-friendly board based on the ATmega328 (Arduino Nano 3.0) or ATmega168 (Arduino Nano 2.x). It has more or less the same functionality of the Arduino Duemilanove, but in a different package. It lacks only a DC power jack, and works with a Mini-B USB cable instead of a standard one&lt;br /&gt;
&lt;br /&gt;
Clones:&lt;br /&gt;
* DFRoduino Nano&lt;br /&gt;
* [http://littlegreenmartian.net/index.php?page=shop.product_details&amp;amp;category_id=1&amp;amp;flypage=flypage.tpl&amp;amp;product_id=5&amp;amp;option=com_virtuemart&amp;amp;Itemid=55&amp;amp;vmcchk=1&amp;amp;Itemid=55 HACEduino 2009 Nano]&lt;br /&gt;
&lt;br /&gt;
====[http://www.arduino.cc/en/Main/ArduinoBoardMini Mini] (SmartProjects)====&lt;br /&gt;
based on the ATmega168&lt;br /&gt;
&lt;br /&gt;
the smallest of the serie. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 8 analog inputs, and a 16 MHz crystal oscillator. It can be programmed with the Mini USB adapter or other USB or RS232 to TTL serial adapter. &lt;br /&gt;
&lt;br /&gt;
====[http://arduino.cc/en/Main/ArduinoBoardMega Mega] (SmartProjects)====&lt;br /&gt;
based on the ATmega1280&lt;br /&gt;
&lt;br /&gt;
54 Digital I/O Pins (of which 14 provide PWM) / 16 Analog Input Pins&lt;br /&gt;
&lt;br /&gt;
====Other clones or derivatives====&lt;br /&gt;
* [http://spiffie.org/kits/iduino/ iDuino], a breadboardable version&lt;br /&gt;
* [http://www.adafruit.com/index.php?main_page=index&amp;amp;cPath=19 Boarduino], another breadboardable version, see also [http://www.ladyada.net/make/boarduino/ here]&lt;br /&gt;
* [http://spiffie.org/kits/stickduino/ Stickduino], USB Stick Sized Arduino Clone&lt;br /&gt;
* [http://spiffie.org/kits/duinostamp/ DuinoStamp]&lt;br /&gt;
* [http://moderndevice.com/RBBB_revB.shtml Really Bare Bones Board], minimalist, smallest one?&lt;br /&gt;
* [http://leaflabs.com/devices/maple/], compatible with Arduino but powered by a 72MHz ARM core!&lt;br /&gt;
* [http://timewitharduino.blogspot.com/2009/07/introducing-wiseduino.html Wiseduino], an Arduino-compatible microcontroller board, which includes a DS1307 real time clock (RTC) with backup battery, a 24LC256 EEPROM chip and a connector for XBee adapter for wireless communication.&lt;br /&gt;
* [http://lab.guilhermemartins.net/2009/05/06/paperduino-prints/ Paperduino]&lt;br /&gt;
* [http://www.liquidware.com/shop/show/ILL/Illuminato Illuminato], 42 I/O pins and 64K code space, powered with a ATmega645, see also [http://antipastohw.blogspot.com/2009/01/introducing-illuminato-100-gnu-gpld.html here]&lt;br /&gt;
* [http://www.pjrc.com/teensy/index.html Teensy], based on ATMEGA32U4 or AT90USB646 for Teensy++, small &amp;amp; cheap&lt;br /&gt;
* [http://www.hackinglab.org/pinguino/index_pinguino.html Pinguino], similar concept, based on a PIC&lt;br /&gt;
* [http://www.myamicus.co.uk/content.php?115-Amicus18-Board Amicus18] uses a Microchip PIC® micro microcontroller instead of an Atmel AVR type&lt;br /&gt;
&lt;br /&gt;
===Officials===&lt;br /&gt;
* [http://www.arduino.cc/ Arduino] official website&lt;br /&gt;
===Documentation===&lt;br /&gt;
* [http://www.lulu.com/content/1108699 Arduino notebook v6]&lt;br /&gt;
* [http://www.ladyada.net/learn/arduino/index.html Tutorial], [http://ahmedriaz.com/mind/esketching4designers/ video tutorials] and [http://www.arduino.cc/en/Tutorial/HomePage other examples]&lt;br /&gt;
* [http://arduino.cc/en/Reference/Extended Extended Language Reference]&lt;br /&gt;
* [http://www.arduino.cc/en/Hacking/Programmer Burning sketches to the Arduino board with an external programmer]&lt;br /&gt;
* [http://www.amazon.com/gp/search/ref=sr_adv_b/?search-alias=stripbooks&amp;amp;field-title=arduino Several books] on Amazon...&lt;br /&gt;
* [http://shieldlist.org/ Arduino shield List] &amp;amp; pinouts...&lt;br /&gt;
* [http://makezine.com/arduino/] Arduino by Make&lt;br /&gt;
&lt;br /&gt;
===Programmers===&lt;br /&gt;
* [http://code.google.com/p/mega-isp/ In System Programmers based on the AVR Mega8 chip, including Arduino(tm)]&lt;br /&gt;
* [http://www.mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/ Arduino-based AVR High Voltage Programmer]&lt;br /&gt;
&lt;br /&gt;
===Hardware===&lt;br /&gt;
====Shopping====&lt;br /&gt;
* [http://www.sparkfun.com/commerce/categories.php?c=103 SparkFun]&lt;br /&gt;
* [http://www.adafruit.com/ Adafruit]&lt;br /&gt;
* [http://www.nuelectronics.com/estore/ nuelectronics]&lt;br /&gt;
* [https://www.watterott.com/Arduino-project Watterott]&lt;br /&gt;
* [http://store.fundamentallogic.com/ecom/ FundamentalLogic] &amp;amp; [http://spiffie.org/electronics/ Spiff&#039;s Electronics]&lt;br /&gt;
* [http://www.nkcelectronics.com/arduino.html NKC Electronics]&lt;br /&gt;
* [http://www.ge-th.com GE-TH], General Electronics Tech, located in ShenZhen, China&lt;br /&gt;
* [http://be01.rs-online.com/web/search/searchBrowseAction.html?method=searchProducts&amp;amp;searchTerm=arduino RS]&lt;br /&gt;
* [http://www.cooking-hacks.com/index.php/shop/arduino.html Cooking-hacks] by libelium, nice shields...&lt;br /&gt;
&lt;br /&gt;
====Ethernet====&lt;br /&gt;
[http://www.adafruit.com/index.php?main_page=product_info&amp;amp;cPath=17&amp;amp;products_id=83 Ethernet shield]&lt;br /&gt;
* [http://www.ewiznet.com/ wiznet]&lt;br /&gt;
* [http://www.gridconnect.com/xportdirect.html xport], older but with DHCP&lt;br /&gt;
* See also [http://www.ladyada.net/make/eshield/ here]&lt;br /&gt;
&lt;br /&gt;
====LCD====&lt;br /&gt;
* [http://arduino.cc/en/Tutorial/LiquidCrystal Tutorial] with LiquidCrystal library, for Hitachi HD44780 compatible LCDs&lt;br /&gt;
&lt;br /&gt;
====Misc links to explore====&lt;br /&gt;
* http://www.freeduino.org/&lt;br /&gt;
* http://enerduino.blogspot.com/2009/12/enerduino-english.html&lt;br /&gt;
* SDcard http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206874649/8&lt;br /&gt;
&lt;br /&gt;
===Software===&lt;br /&gt;
* [http://fritzing.org/ Fritzing] is an open-source initiative to support designers, artists, researchers and hobbyists to work creatively with interactive electronics.&lt;br /&gt;
* [http://nootropicdesign.com/toolduino/ Toolduino] lets you easily interact with your Arduino hardware so you can test the circuits you create. Toolduino is written in the Processing languange and is available for Windows, Mac OS X, and Linux.&lt;br /&gt;
** The Arduino must be running the [http://firmata.org/wiki/Main_Page Firmata firmware] that comes with the Arduino IDE&lt;br /&gt;
* [http://www.modk.it/ ModKit] is a HTML5 visual programming environment for Arduino&lt;br /&gt;
* [http://seaside.citilab.eu/scratch/arduino Scratch for Arduino]. Scratch is a learning environment developed by the Lifelong Kindergarten Group at MIT Media Lab&lt;br /&gt;
&lt;br /&gt;
==Arduino and Linux==&lt;br /&gt;
===Installation===&lt;br /&gt;
Main instructions are [http://www.arduino.cc/playground/Learning/Linux here]&lt;br /&gt;
&lt;br /&gt;
As I&#039;m using a Debian AMD 64bit, here is what I did:&lt;br /&gt;
&lt;br /&gt;
Installing java from Sun and making sure it will be called by the tools. It might be that other java suites are working but at least java-gcj is missing a GtkLookAndFeel component that Arduino GUI is using&lt;br /&gt;
&amp;lt;br&amp;gt;So if you don&#039;t have it yet:&lt;br /&gt;
 aptitude install sun-java6-jre&lt;br /&gt;
&amp;lt;br&amp;gt;Then if it&#039;s not the one by default, change it: (maybe &amp;quot;java&amp;quot; is enough but let&#039;s be consistent)&lt;br /&gt;
 update-alternatives --config java&lt;br /&gt;
 update-alternatives --config jar&lt;br /&gt;
 update-alternatives --config keytool&lt;br /&gt;
 update-alternatives --config orbd&lt;br /&gt;
 update-alternatives --config rmid&lt;br /&gt;
 update-alternatives --config rmiregistry&lt;br /&gt;
 update-alternatives --config serialver&lt;br /&gt;
Other dependencies:&lt;br /&gt;
 aptitude install avr-libc gcc-avr&lt;br /&gt;
[http://code.google.com/p/arduino/ Arduino tools], here v0017:&lt;br /&gt;
 wget http://arduino.googlecode.com/files/arduino-0017.tgz&lt;br /&gt;
 tar xzf arduino-0017.tgz&lt;br /&gt;
Arduino tools are coming only for 32bit but it contains only a few executables so let&#039;s install the 64bit version of those executables&lt;br /&gt;
&amp;lt;br&amp;gt;Initially I did the following:&lt;br /&gt;
 aptitude install librxtx-java&lt;br /&gt;
 rm arduino-0017/lib/librxtxSerial.so&lt;br /&gt;
But at time of writing, Debian was only proposing v2.1.7 and if uploading sketches to the Arduino worked, launching the serial monitor provoked a big crash of Java. So better to follow [http://feelslikeburning.com/2009/08/21/how-to-get-arduino-0017-working-on-64-bit-linux-including-ubuntu-9-04/ this post]:&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;Download [http://rxtx.qbang.org/wiki/index.php/Download rxtx-2.2pre2-bins] from the RXTX folks. Extract the files, and copy RXTXcomm.jar and x86_64-unknown-linux-gnu/librxtxSerial.so to the Arduino lib/ directory, basically replacing the two files that came shipped with Arduino 0017.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is also the avrdude binary in arduino-0017 which is compiled as 32bit executable.&lt;br /&gt;
&amp;lt;br&amp;gt;You can recompile it from the source or if you have the ia32-libs package, the 32bit binary provided will work out-of-the-box.&lt;br /&gt;
&amp;lt;br&amp;gt;But in any ways, &#039;&#039;&#039;DON&#039;T USE AVRDUDE FROM YOUR DISTRO!&#039;&#039;&#039; because the one provided with the Arduino tools is a patched version.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s try to launch the script arduino-0017/arduino&lt;br /&gt;
 Tools/SerialPort/&amp;quot;/dev/ttyUSB0&amp;quot;&lt;br /&gt;
 Tools/Board/&amp;quot;Arduino Diecimila, Duemilanove or Nanoe, w/ Atmega168&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now trying the very first code:&lt;br /&gt;
&amp;lt;br&amp;gt;See [http://www.ladyada.net/learn/arduino/lesson1.html this tuto]&lt;br /&gt;
&lt;br /&gt;
===Problem with the original avrdude===&lt;br /&gt;
As I told in the previous section, don&#039;t use the avrdude coming with your distro. Initially this is what I did and here are the problems I faced:&lt;br /&gt;
 aptitude install avrdude avrdude-doc&lt;br /&gt;
 cd arduino-0017/hardware/tools&lt;br /&gt;
 mv avrdude avrdude.disabled&lt;br /&gt;
 mv avrdude.conf avrdude.conf.disabled&lt;br /&gt;
 ln -s /usr/bin/avrdude&lt;br /&gt;
 ln -s /etc/avrdude.conf&lt;br /&gt;
&#039;&#039;&#039;DON&#039;T USE AVRDUDE FROM YOUR DISTRO!&#039;&#039;&#039;&lt;br /&gt;
Then when trying to upload the bin to the board (menu -&amp;gt; Upload to I/O board), I got the following message:&lt;br /&gt;
 Binary sketch size: 896 bytes (of a 14336 byte maximum)&lt;br /&gt;
 avrdude: Yikes!  Invalid device signature.&lt;br /&gt;
        Double check connections and try again, or use -F to override this check.&lt;br /&gt;
Then I tried to inject the -F option to avrdude, it flashed the chip, gave me still errors:&lt;br /&gt;
 Wrong microcontroller found. Did you select the right board in the Tools &amp;gt; Board menu?&lt;br /&gt;
 avrdude: Yikes!  Invalid device signature.&lt;br /&gt;
 avrdude: Expected signature for ATMEGA168 is 1E 94 06&lt;br /&gt;
But the code was apparently correctly uploaded to the board as I got my blinking LED...&lt;br /&gt;
&lt;br /&gt;
Avrdude which is part of the arduino-0017 release is a patched version as it says:&lt;br /&gt;
 Version 5.4-arduino&lt;br /&gt;
While the version in Debian Squeeze is:&lt;br /&gt;
 Version 5.8&lt;br /&gt;
So apparently we need absolutely to use the special arduino version.&lt;br /&gt;
===Using USBtinyISP===&lt;br /&gt;
USBtinyISP is not driven by a USB-to-serial converter or a driver but by libusb.&lt;br /&gt;
&amp;lt;br&amp;gt;Therefore you must have the right to use libusb.&lt;br /&gt;
&amp;lt;br&amp;gt;As running the IDE as root is not a very wise solution, here is another one using udev:&lt;br /&gt;
* Create /etc/udev/rules.d/usbtiny.rules&lt;br /&gt;
 # udev rules file for USBtinyISP (for udev 0.98 version)&lt;br /&gt;
 &lt;br /&gt;
 SUBSYSTEM!=&amp;quot;usb|usb_device&amp;quot;, GOTO=&amp;quot;usbtiny_rules_end&amp;quot;&lt;br /&gt;
 ACTION!=&amp;quot;add&amp;quot;, GOTO=&amp;quot;usbtiny_rules_end&amp;quot;&lt;br /&gt;
 ATTRS{idVendor}==&amp;quot;1781&amp;quot;, ATTRS{idProduct}==&amp;quot;0c9f&amp;quot;, ATTRS{product}==&amp;quot;USBtiny&amp;quot;, MODE=&amp;quot;0664&amp;quot;, GROUP=&amp;quot;plugdev&amp;quot;&lt;br /&gt;
 LABEL=&amp;quot;usbtiny_rules_end&amp;quot;&lt;br /&gt;
* Restart udev&lt;br /&gt;
 /etc/init.d/udev restart&lt;br /&gt;
* Add yourself to the plugdev group if not yet done&lt;br /&gt;
 adduser toto plugdev&lt;br /&gt;
* Unplug and plug back your USBtiny board&lt;br /&gt;
===Monitoring avrdude calls===&lt;br /&gt;
One annoyance of the GUI is that I don&#039;t know what the GUI is doing with avrdude so I wanted to intercept &amp;amp; log the calls to avrdude:&lt;br /&gt;
&amp;lt;br&amp;gt;In arduino-0017/hardware/tools move avrdude to avrdude.orig&lt;br /&gt;
&amp;lt;br&amp;gt;Then create a script called avrdude (make it executable!) with:&lt;br /&gt;
 script -q -a $(dirname $0)/avrdude.log -c &amp;quot;echo \&amp;quot;$0 $*\&amp;quot; &amp;amp;&amp;amp; $0.orig $*&amp;quot;&lt;br /&gt;
It will creates a logfile called avrdude.log in the same directory and as bonus you&#039;ll see also directly the calls to avrdude with all the arguments in the GUI console.&lt;br /&gt;
&lt;br /&gt;
==Projects==&lt;br /&gt;
===[[Arduino Brucon|Brucon Blink blink]]===&lt;br /&gt;
===[[Arduino VFD brightness|VFD brightness control]]===&lt;br /&gt;
===[[Arduino EMF|Yet another EMF detector]]===&lt;br /&gt;
===[[Arduino Photoduino|Photoduino]]===&lt;br /&gt;
Personal notes about a wonderful spanish project&lt;br /&gt;
===[[Arduino PDU]]===&lt;br /&gt;
&lt;br /&gt;
==TODO &amp;amp; ideas==&lt;br /&gt;
* Temperature alarm for tea preparation&lt;br /&gt;
* LED cube?&lt;br /&gt;
* POV sth? sphere?&lt;br /&gt;
&lt;br /&gt;
==My stuff==&lt;br /&gt;
* [http://www.nuelectronics.com/estore/index.php?main_page=product_info&amp;amp;cPath=1&amp;amp;products_id=1 Freeduino V1.16 Board]&lt;br /&gt;
* [http://www.arduino.cc/en/Main/ArduinoEthernetShield EthShield SD]&lt;br /&gt;
* [http://arduino.cc/en/Main/ArduinoBoardPro Arduino Pro] 5V 16MHz w/ ATmega328&lt;br /&gt;
** [http://www.sparkfun.com/commerce/product_info.php?products_id=9115 FTDI Basic Breakout 5V]&lt;br /&gt;
* [http://www.ladyada.net/make/boarduino/ USB Boarduino] w/ ATmega328&lt;br /&gt;
* [http://www.ladyada.net/make/usbtinyisp/ USBtinyISP]&lt;br /&gt;
* [http://leaflabs.com/devices/maple/ Maple w/ ARM 72MHz]&lt;br /&gt;
* [http://www.ladyada.net/make/tvbgone/ TV-B-Gone Kit]&lt;br /&gt;
&lt;br /&gt;
==TV-B-Gone==&lt;br /&gt;
* [http://www.tvbgone.com/cfe_tvbg_main.php As a product]&lt;br /&gt;
** [http://www.tvbgone-fr.com/blog/index.php?Accueil French site]&lt;br /&gt;
* [http://www.ladyada.net/make/tvbgone/index.html As a kit]&lt;br /&gt;
** [http://forums.adafruit.com/viewforum.php?f=23 Forum]&lt;br /&gt;
** Issue to use ISP? See [http://forums.adafruit.com/viewtopic.php?t=4438 here], in short it&#039;s easier to use a breadboard or [http://tinkerlog.com/howto/tiny25-header/ Tiny25 header]...&lt;br /&gt;
* [https://code.google.com/p/tv-b-gone/ Yet another clone]&lt;/div&gt;</summary>
		<author><name>Dorian</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Arduino&amp;diff=6347</id>
		<title>Arduino</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Arduino&amp;diff=6347"/>
		<updated>2010-07-16T09:54:28Z</updated>

		<summary type="html">&lt;p&gt;Dorian: /* Misc links to explore */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So after the [http://www.brucon.org/index.php/Workshops#Arduino:_how_we_made_the_beerduino Arduino workshop] at BruCON 2009 (pics [http://gallery.yobi.be/v/divers/evenements/brucon2009/IMG_9977.JPG.html here]), I was seduced by this little development board.&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Arduino Arduino on Wikipedia]&lt;br /&gt;
===boards &amp;amp; clones===&lt;br /&gt;
====[http://arduino.cc/en/Main/ArduinoBoardDuemilanove Duemilanove] (SmartProjects)====&lt;br /&gt;
The Duemilanove automatically selects the appropriate power supply (USB or external power), eliminating the need for the power selection jumper found on previous boards. It also adds an easiest to cut trace for disabling the auto-reset, along with a solder jumper for re-enabling it.&lt;br /&gt;
&lt;br /&gt;
based on the ATmega168, latest versions are based on ATmega328p&lt;br /&gt;
&lt;br /&gt;
Clones:&lt;br /&gt;
* Roboduino&lt;br /&gt;
* [http://spiffie.org/kits/freeduino2009/ Freeduino 2009], an (almost) all through hole remake&lt;br /&gt;
* [http://www.ge-th.com/product.asp?id=118 Chinduino Duemilanove168-20PU] or [http://www.ge-th.com/product.asp?id=119 Duemilanove328-20PU]&lt;br /&gt;
&lt;br /&gt;
====[http://arduino.cc/en/Main/ArduinoBoardDecimilia Decimilia] (SmartProjects)====&lt;br /&gt;
Version before Duemilanove, with a jumper to select the power supply (USB or external power)&lt;br /&gt;
&lt;br /&gt;
based on the Atmega168, can be upgraded with a ATmega328&lt;br /&gt;
&lt;br /&gt;
Clones:&lt;br /&gt;
* [http://www.nuelectronics.com/estore/index.php?main_page=product_info&amp;amp;cPath=1&amp;amp;products_id=1 Freeduino V1.16 Board]&lt;br /&gt;
* Freeduino MaxSerial&lt;br /&gt;
* HACEduino &amp;quot;2009&amp;quot;&lt;br /&gt;
* Fino168 USB Board&lt;br /&gt;
** with a DIP switch to disable auto-reset and D13 LED&lt;br /&gt;
* Duino168 Serial Board&lt;br /&gt;
** with a DIP switch to disable auto-reset and D13 LED&lt;br /&gt;
* Duino328 Serial Board&lt;br /&gt;
** with a DIP switch to disable auto-reset and D13 LED&lt;br /&gt;
* [http://www.makershed.com/ProductDetails.asp?ProductCode=MKSEEED2&amp;amp;ampClick=19209 Seeeduino]&lt;br /&gt;
&lt;br /&gt;
====[http://arduino.cc/en/Main/ArduinoBoardLilypad Lilypad] (SparkFun)====&lt;br /&gt;
based on the ATmega168V on v03 (the low-power version of the ATmega168) or the ATmega328V on v04&lt;br /&gt;
&lt;br /&gt;
====[http://arduino.cc/en/Main/ArduinoBoardPro Pro] (SparkFun)====&lt;br /&gt;
based on the ATmega168 or ATmega328. The Pro comes in both 3.3V / 8 MHz and 5V / 16 MHz versions. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a battery power jack, a power switch, a reset button, and holes for mounting a power jack, an ICSP header, and pin headers. A six pin header can be connected to an FTDI cable or Sparkfun breakout board to provide USB power and communication to the board.&lt;br /&gt;
&lt;br /&gt;
The Arduino Pro is intended for semi-permanent installation in objects or exhibitions. The board comes without pre-mounted headers, allowing the use of various types of connectors or direct soldering of wires. The pin layout is compatible with Arduino shields. The 3.3V versions of the Pro can be powered with a battery.&lt;br /&gt;
&lt;br /&gt;
Take care that the embedded power regulator is smaller and outputs max 150mA&lt;br /&gt;
&lt;br /&gt;
====[http://arduino.cc/en/Main/ArduinoBoardProMini Pro Mini] (SparkFun)====&lt;br /&gt;
based on the ATmega168. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, an on-board resonator, a reset button, and holes for mounting pin headers. A six pin header can be connected to an FTDI cable or Sparkfun breakout board to provide USB power and communication to the board.&lt;br /&gt;
&lt;br /&gt;
The Arduino Pro Mini is intended for semi-permanent installation in objects or exhibitions. The board comes without pre-mounted headers, allowing the use of various types of connectors or direct soldering of wires. The pin layout is compatible with the Arduino Mini.&lt;br /&gt;
&lt;br /&gt;
There are two version of the Pro Mini. One runs at 3.3V and 8 MHz, the other at 5V and 16 MHz.&lt;br /&gt;
&lt;br /&gt;
====[http://www.arduino.cc/en/Main/ArduinoBoardNano Nano] (Gravitech)====&lt;br /&gt;
small, complete, and breadboard-friendly board based on the ATmega328 (Arduino Nano 3.0) or ATmega168 (Arduino Nano 2.x). It has more or less the same functionality of the Arduino Duemilanove, but in a different package. It lacks only a DC power jack, and works with a Mini-B USB cable instead of a standard one&lt;br /&gt;
&lt;br /&gt;
Clones:&lt;br /&gt;
* DFRoduino Nano&lt;br /&gt;
* [http://littlegreenmartian.net/index.php?page=shop.product_details&amp;amp;category_id=1&amp;amp;flypage=flypage.tpl&amp;amp;product_id=5&amp;amp;option=com_virtuemart&amp;amp;Itemid=55&amp;amp;vmcchk=1&amp;amp;Itemid=55 HACEduino 2009 Nano]&lt;br /&gt;
&lt;br /&gt;
====[http://www.arduino.cc/en/Main/ArduinoBoardMini Mini] (SmartProjects)====&lt;br /&gt;
based on the ATmega168&lt;br /&gt;
&lt;br /&gt;
the smallest of the serie. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 8 analog inputs, and a 16 MHz crystal oscillator. It can be programmed with the Mini USB adapter or other USB or RS232 to TTL serial adapter. &lt;br /&gt;
&lt;br /&gt;
====[http://arduino.cc/en/Main/ArduinoBoardMega Mega] (SmartProjects)====&lt;br /&gt;
based on the ATmega1280&lt;br /&gt;
&lt;br /&gt;
54 Digital I/O Pins (of which 14 provide PWM) / 16 Analog Input Pins&lt;br /&gt;
&lt;br /&gt;
====Other clones or derivatives====&lt;br /&gt;
* [http://spiffie.org/kits/iduino/ iDuino], a breadboardable version&lt;br /&gt;
* [http://spiffie.org/kits/stickduino/ Stickduino], USB Stick Sized Arduino Clone&lt;br /&gt;
* [http://spiffie.org/kits/duinostamp/ DuinoStamp]&lt;br /&gt;
* [http://moderndevice.com/RBBB_revB.shtml Really Bare Bones Board], minimalist, smallest one?&lt;br /&gt;
* [http://leaflabs.com/tiki-index.php?page=Maple Maple], compatible with Arduino but powered by a 72MHz ARM core!&lt;br /&gt;
* [http://timewitharduino.blogspot.com/2009/07/introducing-wiseduino.html Wiseduino], an Arduino-compatible microcontroller board, which includes a DS1307 real time clock (RTC) with backup battery, a 24LC256 EEPROM chip and a connector for XBee adapter for wireless communication.&lt;br /&gt;
* [http://lab.guilhermemartins.net/2009/05/06/paperduino-prints/ Paperduino]&lt;br /&gt;
* [http://www.liquidware.com/shop/show/ILL/Illuminato Illuminato], 42 I/O pins and 64K code space, powered with a ATmega645, see also [http://antipastohw.blogspot.com/2009/01/introducing-illuminato-100-gnu-gpld.html here]&lt;br /&gt;
* [http://www.pjrc.com/teensy/index.html Teensy], based on ATMEGA32U4 or AT90USB646 for Teensy++, small &amp;amp; cheap&lt;br /&gt;
* [http://www.hackinglab.org/pinguino/index_pinguino.html Pinguino], similar concept, based on a PIC&lt;br /&gt;
&lt;br /&gt;
===Officials===&lt;br /&gt;
* [http://www.arduino.cc/ Arduino] official website&lt;br /&gt;
===Documentation===&lt;br /&gt;
* [http://www.lulu.com/content/1108699 Arduino notebook v6]&lt;br /&gt;
* [http://www.ladyada.net/learn/arduino/index.html Tutorial], [http://ahmedriaz.com/mind/esketching4designers/ video tutorials] and [http://www.arduino.cc/en/Tutorial/HomePage other examples]&lt;br /&gt;
* [http://arduino.cc/en/Reference/Extended Extended Language Reference]&lt;br /&gt;
* [http://www.arduino.cc/en/Hacking/Programmer Burning sketches to the Arduino board with an external programmer]&lt;br /&gt;
===Programmers===&lt;br /&gt;
* [http://code.google.com/p/mega-isp/ In System Programmers based on the AVR Mega8 chip, including Arduino(tm)]&lt;br /&gt;
* [http://www.mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/ Arduino-based AVR High Voltage Programmer]&lt;br /&gt;
&lt;br /&gt;
===Hardware===&lt;br /&gt;
====Shopping====&lt;br /&gt;
* [http://www.sparkfun.com/commerce/categories.php?c=103 SparkFun]&lt;br /&gt;
* [http://www.adafruit.com/ Adafruit]&lt;br /&gt;
* [http://www.nuelectronics.com/estore/ nuelectronics]&lt;br /&gt;
* [https://www.watterott.com/Arduino-project Watterott]&lt;br /&gt;
* [http://store.fundamentallogic.com/ecom/ FundamentalLogic] &amp;amp; [http://spiffie.org/electronics/ Spiff&#039;s Electronics]&lt;br /&gt;
* [http://www.nkcelectronics.com/arduino.html NKC Electronics]&lt;br /&gt;
* [http://www.ge-th.com GE-TH], General Electronics Tech, located in ShenZhen, China&lt;br /&gt;
* [http://be01.rs-online.com/web/search/searchBrowseAction.html?method=searchProducts&amp;amp;searchTerm=arduino RS]&lt;br /&gt;
&lt;br /&gt;
====Ethernet====&lt;br /&gt;
[http://www.adafruit.com/index.php?main_page=product_info&amp;amp;cPath=17&amp;amp;products_id=83 Ethernet shield]&lt;br /&gt;
* [http://www.ewiznet.com/ wiznet]&lt;br /&gt;
* [http://www.gridconnect.com/xportdirect.html xport], older but with DHCP&lt;br /&gt;
* See also [http://www.ladyada.net/make/eshield/ here]&lt;br /&gt;
&lt;br /&gt;
====LCD====&lt;br /&gt;
* [http://arduino.cc/en/Tutorial/LiquidCrystal Tutorial] with LiquidCrystal library, for Hitachi HD44780 compatible LCDs&lt;br /&gt;
&lt;br /&gt;
====Misc links to explore====&lt;br /&gt;
* http://www.freeduino.org/&lt;br /&gt;
* http://enerduino.blogspot.com/2009/12/enerduino-english.html&lt;br /&gt;
* SDcard http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206874649/8&lt;br /&gt;
&lt;br /&gt;
===Software===&lt;br /&gt;
* [http://fritzing.org/ Fritzing] is an open-source initiative to support designers, artists, researchers and hobbyists to work creatively with interactive electronics.&lt;br /&gt;
* [http://nootropicdesign.com/toolduino/ Toolduino] lets you easily interact with your Arduino hardware so you can test the circuits you create. Toolduino is written in the Processing languange and is available for Windows, Mac OS X, and Linux.&lt;br /&gt;
** The Arduino must be running the [http://firmata.org/wiki/Main_Page Firmata firmware] that comes with the Arduino IDE&lt;br /&gt;
&lt;br /&gt;
==Arduino and Linux==&lt;br /&gt;
===Installation===&lt;br /&gt;
Main instructions are [http://www.arduino.cc/playground/Learning/Linux here]&lt;br /&gt;
&lt;br /&gt;
As I&#039;m using a Debian AMD 64bit, here is what I did:&lt;br /&gt;
&lt;br /&gt;
Installing java from Sun and making sure it will be called by the tools. It might be that other java suites are working but at least java-gcj is missing a GtkLookAndFeel component that Arduino GUI is using&lt;br /&gt;
&amp;lt;br&amp;gt;So if you don&#039;t have it yet:&lt;br /&gt;
 aptitude install sun-java6-jre&lt;br /&gt;
&amp;lt;br&amp;gt;Then if it&#039;s not the one by default, change it: (maybe &amp;quot;java&amp;quot; is enough but let&#039;s be consistent)&lt;br /&gt;
 update-alternatives --config java&lt;br /&gt;
 update-alternatives --config jar&lt;br /&gt;
 update-alternatives --config keytool&lt;br /&gt;
 update-alternatives --config orbd&lt;br /&gt;
 update-alternatives --config rmid&lt;br /&gt;
 update-alternatives --config rmiregistry&lt;br /&gt;
 update-alternatives --config serialver&lt;br /&gt;
Other dependencies:&lt;br /&gt;
 aptitude install avr-libc gcc-avr&lt;br /&gt;
[http://code.google.com/p/arduino/ Arduino tools], here v0017:&lt;br /&gt;
 wget http://arduino.googlecode.com/files/arduino-0017.tgz&lt;br /&gt;
 tar xzf arduino-0017.tgz&lt;br /&gt;
Arduino tools are coming only for 32bit but it contains only a few executables so let&#039;s install the 64bit version of those executables&lt;br /&gt;
&amp;lt;br&amp;gt;Initially I did the following:&lt;br /&gt;
 aptitude install librxtx-java&lt;br /&gt;
 rm arduino-0017/lib/librxtxSerial.so&lt;br /&gt;
But at time of writing, Debian was only proposing v2.1.7 and if uploading sketches to the Arduino worked, launching the serial monitor provoked a big crash of Java. So better to follow [http://feelslikeburning.com/2009/08/21/how-to-get-arduino-0017-working-on-64-bit-linux-including-ubuntu-9-04/ this post]:&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;Download [http://rxtx.qbang.org/wiki/index.php/Download rxtx-2.2pre2-bins] from the RXTX folks. Extract the files, and copy RXTXcomm.jar and x86_64-unknown-linux-gnu/librxtxSerial.so to the Arduino lib/ directory, basically replacing the two files that came shipped with Arduino 0017.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is also the avrdude binary in arduino-0017 which is compiled as 32bit executable.&lt;br /&gt;
&amp;lt;br&amp;gt;You can recompile it from the source or if you have the ia32-libs package, the 32bit binary provided will work out-of-the-box.&lt;br /&gt;
&amp;lt;br&amp;gt;But in any ways, &#039;&#039;&#039;DON&#039;T USE AVRDUDE FROM YOUR DISTRO!&#039;&#039;&#039; because the one provided with the Arduino tools is a patched version.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s try to launch the script arduino-0017/arduino&lt;br /&gt;
 Tools/SerialPort/&amp;quot;/dev/ttyUSB0&amp;quot;&lt;br /&gt;
 Tools/Board/&amp;quot;Arduino Diecimila, Duemilanove or Nanoe, w/ Atmega168&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now trying the very first code:&lt;br /&gt;
&amp;lt;br&amp;gt;See [http://www.ladyada.net/learn/arduino/lesson1.html this tuto]&lt;br /&gt;
&lt;br /&gt;
===Problem with the original avrdude===&lt;br /&gt;
As I told in the previous section, don&#039;t use the avrdude coming with your distro. Initially this is what I did and here are the problems I faced:&lt;br /&gt;
 aptitude install avrdude avrdude-doc&lt;br /&gt;
 cd arduino-0017/hardware/tools&lt;br /&gt;
 mv avrdude avrdude.disabled&lt;br /&gt;
 mv avrdude.conf avrdude.conf.disabled&lt;br /&gt;
 ln -s /usr/bin/avrdude&lt;br /&gt;
 ln -s /etc/avrdude.conf&lt;br /&gt;
&#039;&#039;&#039;DON&#039;T USE AVRDUDE FROM YOUR DISTRO!&#039;&#039;&#039;&lt;br /&gt;
Then when trying to upload the bin to the board (menu -&amp;gt; Upload to I/O board), I got the following message:&lt;br /&gt;
 Binary sketch size: 896 bytes (of a 14336 byte maximum)&lt;br /&gt;
 avrdude: Yikes!  Invalid device signature.&lt;br /&gt;
        Double check connections and try again, or use -F to override this check.&lt;br /&gt;
Then I tried to inject the -F option to avrdude, it flashed the chip, gave me still errors:&lt;br /&gt;
 Wrong microcontroller found. Did you select the right board in the Tools &amp;gt; Board menu?&lt;br /&gt;
 avrdude: Yikes!  Invalid device signature.&lt;br /&gt;
 avrdude: Expected signature for ATMEGA168 is 1E 94 06&lt;br /&gt;
But the code was apparently correctly uploaded to the board as I got my blinking LED...&lt;br /&gt;
&lt;br /&gt;
Avrdude which is part of the arduino-0017 release is a patched version as it says:&lt;br /&gt;
 Version 5.4-arduino&lt;br /&gt;
While the version in Debian Squeeze is:&lt;br /&gt;
 Version 5.8&lt;br /&gt;
So apparently we need absolutely to use the special arduino version.&lt;br /&gt;
===Using USBtinyISP===&lt;br /&gt;
USBtinyISP is not driven by a USB-to-serial converter or a driver but by libusb.&lt;br /&gt;
&amp;lt;br&amp;gt;Therefore you must have the right to use libusb.&lt;br /&gt;
&amp;lt;br&amp;gt;As running the IDE as root is not a very wise solution, here is another one using udev:&lt;br /&gt;
* Create /etc/udev/rules.d/usbtiny.rules&lt;br /&gt;
 # udev rules file for USBtinyISP (for udev 0.98 version)&lt;br /&gt;
 &lt;br /&gt;
 SUBSYSTEM!=&amp;quot;usb|usb_device&amp;quot;, GOTO=&amp;quot;usbtiny_rules_end&amp;quot;&lt;br /&gt;
 ACTION!=&amp;quot;add&amp;quot;, GOTO=&amp;quot;usbtiny_rules_end&amp;quot;&lt;br /&gt;
 ATTRS{idVendor}==&amp;quot;1781&amp;quot;, ATTRS{idProduct}==&amp;quot;0c9f&amp;quot;, ATTRS{product}==&amp;quot;USBtiny&amp;quot;, MODE=&amp;quot;0664&amp;quot;, GROUP=&amp;quot;plugdev&amp;quot;&lt;br /&gt;
 LABEL=&amp;quot;usbtiny_rules_end&amp;quot;&lt;br /&gt;
* Restart udev&lt;br /&gt;
 /etc/init.d/udev restart&lt;br /&gt;
* Add yourself to the plugdev group if not yet done&lt;br /&gt;
 adduser toto plugdev&lt;br /&gt;
* Unplug and plug back your USBtiny board&lt;br /&gt;
===Monitoring avrdude calls===&lt;br /&gt;
One annoyance of the GUI is that I don&#039;t know what the GUI is doing with avrdude so I wanted to intercept &amp;amp; log the calls to avrdude:&lt;br /&gt;
&amp;lt;br&amp;gt;In arduino-0017/hardware/tools move avrdude to avrdude.orig&lt;br /&gt;
&amp;lt;br&amp;gt;Then create a script called avrdude (make it executable!) with:&lt;br /&gt;
 script -q -a $(dirname $0)/avrdude.log -c &amp;quot;echo \&amp;quot;$0 $*\&amp;quot; &amp;amp;&amp;amp; $0.orig $*&amp;quot;&lt;br /&gt;
It will creates a logfile called avrdude.log in the same directory and as bonus you&#039;ll see also directly the calls to avrdude with all the arguments in the GUI console.&lt;br /&gt;
&lt;br /&gt;
==Projects==&lt;br /&gt;
===[[Arduino Brucon|Brucon Blink blink]]===&lt;br /&gt;
===[[Arduino VFD brightness|VFD brightness control]]===&lt;br /&gt;
===[[Arduino EMF|Yet another EMF detector]]===&lt;br /&gt;
==TODO &amp;amp; ideas==&lt;br /&gt;
* Intervalometer for my Canon EOS350D, see e.g. [http://etharooni.polorix.net/NikonRemote.html this one] for Nikon&lt;br /&gt;
* Temperature alarm for tea preparation&lt;br /&gt;
* LED cube?&lt;br /&gt;
* POV sth? sphere?&lt;/div&gt;</summary>
		<author><name>Dorian</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Fetchmail&amp;diff=6207</id>
		<title>Fetchmail</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Fetchmail&amp;diff=6207"/>
		<updated>2010-05-22T15:15:52Z</updated>

		<summary type="html">&lt;p&gt;Dorian: /* Troubleshooting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Installation de Fetchmail==&lt;br /&gt;
 apt-get install fetchmail&lt;br /&gt;
installer un fichier /etc/fetchmailrc comme celui-ci:&lt;br /&gt;
&lt;br /&gt;
==fetchmailrc==&lt;br /&gt;
Exemple de /etc/fetchmailrc:&lt;br /&gt;
&lt;br /&gt;
 set postmaster &amp;quot;fetchmail&amp;quot;&lt;br /&gt;
 set nobouncemail&lt;br /&gt;
 set no spambounce&lt;br /&gt;
 set properties &amp;quot;&amp;quot;&lt;br /&gt;
 set daemon 120&lt;br /&gt;
 &lt;br /&gt;
 # IMAP without SSL/TLS&lt;br /&gt;
 poll courriel.latribu.com with proto IMAP&lt;br /&gt;
        user &#039;xxxx.xxxx@latribu.com&#039; there with password &#039;xxxx&#039; is &#039;phil&#039; here fetchall&lt;br /&gt;
 # IMAP with SSL port 993&lt;br /&gt;
 poll mail.hellea.be with proto IMAP and with interval 5&lt;br /&gt;
        user &#039;xxxx&#039; there with password &#039;xxxx&#039; is &#039;phil&#039; here fetchall ssl sslfingerprint  &amp;quot;24:96:59:5C:A2:D0:60:14:FA:CD:66:32:40:CC:CA:1D&amp;quot;&lt;br /&gt;
 # IMAP with TLS port 143&lt;br /&gt;
 poll mail.hellea.be with proto IMAP and with interval 5&lt;br /&gt;
        user &#039;xxxx&#039; there with password &#039;xxxx&#039; is &#039;phil&#039; here fetchall sslfingerprint  &amp;quot;24:96:59:5C:A2:D0:60:14:FA:CD:66:32:40:CC:CA:1D&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Pour avoir les sslfingerprints:&lt;br /&gt;
 su fetchmail -c &amp;quot;fetchmail -f /etc/fetchmailrc -v -v -N&amp;quot;&lt;br /&gt;
&lt;br /&gt;
C&#039;est important de spécifier les fingerprints sinon on se retrouve avec des erreurs dans les logs system: &lt;br /&gt;
 fetchmail[1234]: Server certificate verification error: self signed certificate&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
Lorsqu&#039;on rencontre une erreur du style:&lt;br /&gt;
 9 messages pour acount_name dans mail.teledisnet.be (47569 octets).&lt;br /&gt;
 fetchmail: erreur protocole client/serveur durant la réception de mail.teledisnet.be&lt;br /&gt;
 fetchmail: État de la requête=4 (PROTOCOLE)&lt;br /&gt;
&lt;br /&gt;
Un fetchmail -v donne :&lt;br /&gt;
 fetchmail: POP3&amp;gt; TOP 1 99999999&lt;br /&gt;
 fetchmail: POP3&amp;lt; -ERR No more than 0 lines can be retrieved with TOP command&lt;br /&gt;
 fetchmail: No more than 0 lines can be retrieved with TOP command&lt;br /&gt;
&lt;br /&gt;
l&#039;histoire c&#039;est que le provider en question ici teledisnet n&#039;accepte plus la commande TOP 1 999999 et il faut donc forcer fetchmail à utiliser la commande RETR&lt;br /&gt;
&lt;br /&gt;
Il suffit simplement d&#039;ajouter dans le fichier ~/.fetchmailrc le mot fetchall en fin de la dernière  ligne&lt;br /&gt;
&lt;br /&gt;
Exemple :&lt;br /&gt;
&lt;br /&gt;
 poll mail.teledisnet.be with proto POP3&lt;br /&gt;
 user &#039;acount_name&#039; there with password &#039;XXXXXXXX&#039; is &#039;dorian&#039; here fetchall&lt;br /&gt;
&lt;br /&gt;
=== Specifique a pop.bgc.be ===&lt;br /&gt;
Fetchmail de la distro lenny parle &amp;quot;GSSAPI&amp;quot;, malheureusement pour nous, le serveur exchange de BGC et mal configurer ou un brol dans le style toujours est-il que celui-ci nous renvoi comme message : &#039;Erreur durant l&#039;échange des credentials&#039;&lt;br /&gt;
&lt;br /&gt;
pour contourner le probleme :&lt;br /&gt;
 utilisation du serveur imap a la place, il merdouille aussi, mais ca passe ! [[User:Dorian|Dorian]] 15:15, 22 May 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
==Installation de Fetchyahoo==&lt;br /&gt;
 apt-get install fetchyahoo&lt;br /&gt;
 andrea@olympe:~$ cp /usr/share/doc/fetchyahoo/examples/fetchyahoorc ~/.fetchyahoorc&lt;br /&gt;
 andrea@olympe:~$ echo &amp;quot;0,15,30,45 6-23 * * * /usr/bin/fetchyahoo&amp;quot;|crontab -u andrea -&lt;br /&gt;
&lt;br /&gt;
Édition d&#039;une copie de /usr/share/doc/fetchyahoo/examples/fetchyahoorc dans ~/.fetchyahoorc&lt;br /&gt;
&lt;br /&gt;
==fetchyahoorc==&lt;br /&gt;
Username et password évidemment&lt;br /&gt;
 username = &#039;&#039;yahoo_user_name&#039;&#039;&lt;br /&gt;
 password = &#039;&#039;XXXXXXXX&#039;&#039;&lt;br /&gt;
On choisit de délivrer dans un Maildir (veiller à finir la ligne par le &amp;quot;/&amp;quot; !!)&lt;br /&gt;
 use-spool = 1&lt;br /&gt;
 spool = /home/andrea/Maildir/.Yahoo/&lt;br /&gt;
 spool-mode = append&lt;br /&gt;
Ou alors on délivre via procmail:&lt;br /&gt;
 use-spool = 1&lt;br /&gt;
 spool = procmail&lt;br /&gt;
 spool-mode = pipe&lt;br /&gt;
Théoriquement on peut reprendre jusquà 100 messages mais on a déjà eu une erreur à 97 alors autant rester &#039;&#039;safe&#039;&#039;&lt;br /&gt;
 max-messages = 80&lt;br /&gt;
On le lancera depuis un cron donc on évite d&#039;avoir un output en temps normal&lt;br /&gt;
 quiet = 1&lt;br /&gt;
On vide le répertoire Bulk qui ne contient jamais rien d&#039;intéressant...&lt;br /&gt;
 empty-bulk = 1&lt;br /&gt;
Il semble plus sûr de se déconnecter après coup.&lt;br /&gt;
 logout = 1&lt;/div&gt;</summary>
		<author><name>Dorian</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Debian_Soft_Raid&amp;diff=6057</id>
		<title>Debian Soft Raid</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Debian_Soft_Raid&amp;diff=6057"/>
		<updated>2010-01-07T14:37:38Z</updated>

		<summary type="html">&lt;p&gt;Dorian: /* Fresh install debian */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==How to switch a Debian system on software RAID 1 (mirroring)==&lt;br /&gt;
===Intro===&lt;br /&gt;
Here are just some quick notes to update this page as now everything can be done relatively easily with just mdadm.&lt;br /&gt;
&amp;lt;br&amp;gt;A very interesting page: http://www200.pair.com/mecham/raid/raid1-degraded-etch.html&lt;br /&gt;
&amp;lt;br&amp;gt;It helps getting familiar with the concepts.&lt;br /&gt;
&amp;lt;br&amp;gt;Here it&#039;s not a step-by-step anymore as the first time I used the old method described later and I used the new mdadm-only way to replace a broken drive, build new raid1 arrays as the new drive was larger (and the old smaller than the surviving one) and a raid1 on the /boot and moving from lilo to grub.&lt;br /&gt;
&lt;br /&gt;
===Creating degraded array===&lt;br /&gt;
Here we&#039;re missing /dev/hda3 so we start with only /dev/hdd3:&lt;br /&gt;
 mdadm --create /dev/md0 --raid-devices=2 --level=raid1 missing /dev/hdd3&lt;br /&gt;
And to get it properly set after reboot, we can create mdadm.conf:&lt;br /&gt;
 echo DEVICE partitions &amp;gt; /etc/mdadm/mdadm.conf&lt;br /&gt;
 mdadm --examine --scan &amp;gt;&amp;gt; /etc/mdadm/mdadm.conf&lt;br /&gt;
Edit and check the file manually...&lt;br /&gt;
&amp;lt;br&amp;gt;Then prepare for reboot&lt;br /&gt;
===Preparing for reboot===&lt;br /&gt;
During the configuration, every time we want to reboot, we&#039;ve to make sure to:&lt;br /&gt;
* have the intended partition layout (fdisk)&lt;br /&gt;
* have the intended partitions mounted on the intended mountpoints (mount)&lt;br /&gt;
* have /etc/fstab reflecting the current mounts&lt;br /&gt;
* have /etc/mdadm/mdadm.conf reflecting the current Raid arrays&lt;br /&gt;
* have an initrd reflecting the current situation:&lt;br /&gt;
 dpkg-reconfigure linux-image-...&lt;br /&gt;
This is true also after having added the 2nd partition to a raid1 array&lt;br /&gt;
===Diagnostic===&lt;br /&gt;
Some useful commands to inspect the raid situation:&lt;br /&gt;
 # From what&#039;s currently assembled:&lt;br /&gt;
 cat /proc/mdstat&lt;br /&gt;
 mdadm --detail --scan&lt;br /&gt;
 mdadm --detail /dev/md1&lt;br /&gt;
 # From what&#039;s available as raid partitions&lt;br /&gt;
 mdadm --examine --scan&lt;br /&gt;
 mdadm --examine /dev/hda5&lt;br /&gt;
&lt;br /&gt;
===Repairing a degraded array===&lt;br /&gt;
Later when we&#039;ll be able to integrate /dev/hda3 we&#039;ll do:&lt;br /&gt;
 mdadm /dev/md0 --add /dev/hda3&lt;br /&gt;
Then prepare for reboot&lt;br /&gt;
===/boot===&lt;br /&gt;
Here is one example:&lt;br /&gt;
&amp;lt;br&amp;gt;Initially /boot was not on raid1 but as now it&#039;s possible with grub I did so.&lt;br /&gt;
&amp;lt;br&amp;gt;I had /boot=/dev/hda1 and /boot-img=/dev/hdd1 and I did sth like:&lt;br /&gt;
 umount /dev/hdd1&lt;br /&gt;
 mdadm --create /dev/md1 --raid-devices=2 --level=raid1 missing /dev/hdd1&lt;br /&gt;
 mount /dev/md1 /boot-img&lt;br /&gt;
 cp -a /boot/* /boot-img&lt;br /&gt;
 umount /boot&lt;br /&gt;
 umount /boot-img&lt;br /&gt;
 mdadm /dev/md1 --add /dev/hda1&lt;br /&gt;
 vi /etc/fstab #/dev/md0 /boot ... and delete /boot-img entry&lt;br /&gt;
 grub-install &amp;quot;(hd1)&amp;quot;&lt;br /&gt;
 grub-install &amp;quot;(hd0)&amp;quot;&lt;br /&gt;
 dpkg-reconfigure linux-image-...&lt;br /&gt;
 mdadm --examine --scan |grep md1&amp;gt;&amp;gt; /etc/mdadm.conf&lt;br /&gt;
 reboot&lt;br /&gt;
===Changing super-minor===&lt;br /&gt;
During the process I wanted to change the number associated to an array (/dev/mdX):&lt;br /&gt;
&amp;lt;br&amp;gt;Suppose /dev/md3 = /dev/hda5+/dev/hdd5&lt;br /&gt;
&amp;lt;br&amp;gt;And we want /dev/md2 = /dev/hda5+/dev/hdd5&lt;br /&gt;
 mdadm --stop /dev/md3&lt;br /&gt;
 mdadm --assemble /dev/md2 /dev/hda5 /dev/hdd5&lt;br /&gt;
Then prepare for reboot&lt;br /&gt;
&lt;br /&gt;
===Yaird===&lt;br /&gt;
To rebuild the initrd there are several tools but finally I used yaird which allowed me to preload my IDE driver and get UDMA modes working, which was essential to get sth like 20x faster data transfers!&lt;br /&gt;
&amp;lt;br&amp;gt;I inserted just before the MOUNTDIR keyword which takes care of inserting the needed generic IDE drivers the amd74xx driver I needed for my nVidia chipset:   &lt;br /&gt;
 /etc/yaird/Default.cfg&lt;br /&gt;
 MODULE          amd74xx&lt;br /&gt;
 MOUNTDIR        &amp;quot;/&amp;quot; &amp;quot;/mnt&amp;quot;&lt;br /&gt;
I had also some difficulties when I broke my initrd and had to reboot on a 2.6.14 because apparently kernels pre-2.6.18 cannot generate properly initrd images.&lt;br /&gt;
&amp;lt;br&amp;gt;Hopefully I had a backup of the initrd otherwise try to reboot on a liveCD and chroot or build a new kernel from source without initrd then boot on that one to prepare the initrd.&lt;br /&gt;
&lt;br /&gt;
You can always inspect the initrd by yourself to check things like modules, raid assembly etc, the file is a cpio archive gzip compressed.&lt;br /&gt;
&lt;br /&gt;
===Grub===&lt;br /&gt;
I moved from lilo to grub and installed the first stage on both drives:&lt;br /&gt;
 grub-install &amp;quot;(hd1)&amp;quot;&lt;br /&gt;
 grub-install &amp;quot;(hd0)&amp;quot;&lt;br /&gt;
I edited /etc/kernel-img.conf to have the hooks for Debian kernel automatic installation:&lt;br /&gt;
 postinst_hook = /usr/sbin/update-grub&lt;br /&gt;
 postrm_hook = /usr/sbin/update-grub&lt;br /&gt;
 do_bootloader = no&lt;br /&gt;
I edited /boot/grub/menu.lst and added a fallback directive:&lt;br /&gt;
 default         0&lt;br /&gt;
 fallback        1&lt;br /&gt;
When executing update-grub it creates the following entry:&lt;br /&gt;
 title           Debian GNU/Linux, kernel 2.6.21-2-vserver-k7&lt;br /&gt;
 root            (hd0,0)&lt;br /&gt;
 kernel          /vmlinuz-2.6.21-2-vserver-k7 root=/dev/md0 ro &lt;br /&gt;
 initrd          /initrd.img-2.6.21-2-vserver-k7&lt;br /&gt;
 savedefault&lt;br /&gt;
And I added manually the following one:&lt;br /&gt;
 title           Debian GNU/Linux, kernel 2.6.21-2-vserver-k7 (hd1)&lt;br /&gt;
 root            (hd1,0)&lt;br /&gt;
 kernel          /vmlinuz-2.6.21-2-vserver-k7 root=/dev/md0 ro &lt;br /&gt;
 initrd          /initrd.img-2.6.21-2-vserver-k7&lt;br /&gt;
 savedefault&lt;br /&gt;
But I don&#039;t know how to make it happening automatically via update-grub, anyway in case of a failure of the first harddrive I&#039;ll probably have to reboot manually and Grub is rich enough to allow reconfiguration on-the-fly.&lt;br /&gt;
&amp;lt;br&amp;gt;That&#039;s the major reason why I moved away from lilo.&lt;br /&gt;
&lt;br /&gt;
==How to switch a Debian system on software RAID 1 (mirroring) (OLD)==&lt;br /&gt;
&lt;br /&gt;
Here is how to switch your root (/) filesystem on RAID 1:&lt;br /&gt;
&lt;br /&gt;
Have 2 same disks, let&#039;s say hda and hdc (yep, put them on different IDE controllers!)&lt;br /&gt;
&amp;lt;br&amp;gt;Create a specific small partition for /boot at the very beginning of the first disk (hda) because some (most?) bootloaders don&#039;t understand RAID.&lt;br /&gt;
&amp;lt;br&amp;gt;Mine is hda1-&amp;gt;/boot hda2-&amp;gt;swap hda3-&amp;gt;/&lt;br /&gt;
&amp;lt;br&amp;gt;Install Debian as usual on hda&lt;br /&gt;
&amp;lt;br&amp;gt;Format hdc with a same partition as the / on hda, it&#039;ll be the RAID mirror of /&lt;br /&gt;
&amp;lt;br&amp;gt;My second disk (same vendor, same size) didn&#039;t have the same geometry (C/H/S) but after dd if=/dev/zero of=/dev/hdc bs=512 count=1 fdisk used the same geometry...&lt;br /&gt;
&amp;lt;br&amp;gt;Now it is the same as hda: hdc1-&amp;gt;/boot-img hdc2-&amp;gt;swap hdc3-&amp;gt;/&lt;br /&gt;
 apt-get install initrd-tools raidtools2 mdadm (decline offer to start RAID at boot time)&lt;br /&gt;
Create /etc/raidtab:&lt;br /&gt;
 raiddev                 /dev/md0&lt;br /&gt;
 raid-level              1&lt;br /&gt;
 nr-raid-disks           2&lt;br /&gt;
 nr-spare-disks          0&lt;br /&gt;
 persistent-superblock   1&lt;br /&gt;
 device                  /dev/hdc3&lt;br /&gt;
 raid-disk               0&lt;br /&gt;
 device                  /dev/hda3&lt;br /&gt;
 failed-disk             1&lt;br /&gt;
So the actual / partition is declared as &amp;quot;broken&amp;quot; for the RAID&lt;br /&gt;
&amp;lt;br&amp;gt;Create the RAID:&lt;br /&gt;
 mkraid /dev/md0 (it will say disk1: failed)&lt;br /&gt;
 mkfs.ext3 /dev/md0&lt;br /&gt;
 mount -v /dev/md0 /mnt/root&lt;br /&gt;
Copy the / content:&lt;br /&gt;
 cd /&lt;br /&gt;
 find . -xdev | cpio -pm /mnt/root&lt;br /&gt;
Prepare to reboot on the RAID:&lt;br /&gt;
&amp;lt;br&amp;gt;Edit /etc/mkinitrd/mkinitrd.conf:&lt;br /&gt;
 ROOT=probe -&amp;gt; ROOT=/dev/md0&lt;br /&gt;
&lt;br /&gt;
 mkinitrd -o /boot/initrd.img-raid&lt;br /&gt;
Edit /mnt/root/etc/fstab:&lt;br /&gt;
 /dev/md0 / ext3 defaults,errors=remount-ro 0 1&lt;br /&gt;
Edit /etc/lilo.conf:&lt;br /&gt;
 image=/boot/vmlinuz...&lt;br /&gt;
 label=LinuxRAID&lt;br /&gt;
 root=/dev/md0&lt;br /&gt;
 read-only&lt;br /&gt;
 initrd=/boot/initrd.img-raid&lt;br /&gt;
&lt;br /&gt;
 umount /dev/md0&lt;br /&gt;
 raidstop /dev/md0&lt;br /&gt;
 lilo&lt;br /&gt;
 reboot&lt;br /&gt;
Restore the &amp;quot;broken&amp;quot; RAID:&lt;br /&gt;
 cat /proc/mdstat: we see only one disk&lt;br /&gt;
 raidhotadd /dev/md0 /dev/hda3&lt;br /&gt;
Now the system is synchonizing the &amp;quot;new&amp;quot; RAID partition&lt;br /&gt;
 watch cat /proc/mdstat&lt;br /&gt;
Prepare for next reboot:&lt;br /&gt;
&amp;lt;br&amp;gt;Edit /etc/fstab:&lt;br /&gt;
 failed-disk -&amp;gt; raid-disk&lt;br /&gt;
 mkinitrd -o /boot/initrd.img-raid&lt;br /&gt;
 lilo&lt;br /&gt;
 reboot&lt;br /&gt;
==Automatic watching==&lt;br /&gt;
 dpkg-reconfigure mdadm -&amp;gt; accept mdadm survey daemon and give user who should get alert emails&lt;br /&gt;
Simulating RAID 0 (striping) for the swap:&lt;br /&gt;
&amp;lt;br&amp;gt;Simply give the same priority to both swap partitions:&lt;br /&gt;
 /dev/hda2 swap swap defaults,pri=1 0 0&lt;br /&gt;
 /dev/hdc2 swap swap defaults,pri=1 0 0&lt;br /&gt;
&lt;br /&gt;
== Fresh install debian ==&lt;br /&gt;
[http://www200.pair.com/mecham/raid/raid1.html | A good starting point]&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
Don&#039;t simply dd the MBR from hda to hdc otherwise lilo will complain about a timestamp error, actually that&#039;s because now both disks got the same ID number.&lt;br /&gt;
&amp;lt;br&amp;gt;You can mount the initrd image to check if it contains well the RAID instructions:&lt;br /&gt;
 mount /boot/initrd.img-raid /mnt/disk -o loop,ro&lt;br /&gt;
/mnt/disk/script should contain a last line with mdadm&lt;br /&gt;
&amp;lt;br&amp;gt;check the end of the line, first time only /dev/hdc3 is mentioned, second time /dev/hda3 should also be present (or the system will be mounted again in degraded mode)&lt;br /&gt;
&amp;lt;br&amp;gt;If reboot fails:&lt;br /&gt;
Boot on a Knoppix&lt;br /&gt;
 modprobe raid1&lt;br /&gt;
 mdadm --assemble /dev/md0 /dev/hdd3 /dev/hda3&lt;br /&gt;
 mount /dev/md0 /mnt/xxx&lt;br /&gt;
 chroot /mnt/xxx&lt;br /&gt;
 mount also /proc /boot etc&lt;br /&gt;
 mkinitrd -o /boot/initrd.img-raid &amp;lt;kernel version&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Useful commands==&lt;br /&gt;
&lt;br /&gt;
* Diagnostics&lt;br /&gt;
 mdadm -D /dev/mdXX&lt;br /&gt;
 mdadm -E /dev/hdXX&lt;br /&gt;
 cat /proc/mdstat&lt;br /&gt;
* Add&lt;br /&gt;
 mdadm /dev/mdXX -a /dev/hdXX&lt;/div&gt;</summary>
		<author><name>Dorian</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Debian_Soft_Raid&amp;diff=6056</id>
		<title>Debian Soft Raid</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Debian_Soft_Raid&amp;diff=6056"/>
		<updated>2010-01-07T14:37:21Z</updated>

		<summary type="html">&lt;p&gt;Dorian: /* Fresh install debian */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==How to switch a Debian system on software RAID 1 (mirroring)==&lt;br /&gt;
===Intro===&lt;br /&gt;
Here are just some quick notes to update this page as now everything can be done relatively easily with just mdadm.&lt;br /&gt;
&amp;lt;br&amp;gt;A very interesting page: http://www200.pair.com/mecham/raid/raid1-degraded-etch.html&lt;br /&gt;
&amp;lt;br&amp;gt;It helps getting familiar with the concepts.&lt;br /&gt;
&amp;lt;br&amp;gt;Here it&#039;s not a step-by-step anymore as the first time I used the old method described later and I used the new mdadm-only way to replace a broken drive, build new raid1 arrays as the new drive was larger (and the old smaller than the surviving one) and a raid1 on the /boot and moving from lilo to grub.&lt;br /&gt;
&lt;br /&gt;
===Creating degraded array===&lt;br /&gt;
Here we&#039;re missing /dev/hda3 so we start with only /dev/hdd3:&lt;br /&gt;
 mdadm --create /dev/md0 --raid-devices=2 --level=raid1 missing /dev/hdd3&lt;br /&gt;
And to get it properly set after reboot, we can create mdadm.conf:&lt;br /&gt;
 echo DEVICE partitions &amp;gt; /etc/mdadm/mdadm.conf&lt;br /&gt;
 mdadm --examine --scan &amp;gt;&amp;gt; /etc/mdadm/mdadm.conf&lt;br /&gt;
Edit and check the file manually...&lt;br /&gt;
&amp;lt;br&amp;gt;Then prepare for reboot&lt;br /&gt;
===Preparing for reboot===&lt;br /&gt;
During the configuration, every time we want to reboot, we&#039;ve to make sure to:&lt;br /&gt;
* have the intended partition layout (fdisk)&lt;br /&gt;
* have the intended partitions mounted on the intended mountpoints (mount)&lt;br /&gt;
* have /etc/fstab reflecting the current mounts&lt;br /&gt;
* have /etc/mdadm/mdadm.conf reflecting the current Raid arrays&lt;br /&gt;
* have an initrd reflecting the current situation:&lt;br /&gt;
 dpkg-reconfigure linux-image-...&lt;br /&gt;
This is true also after having added the 2nd partition to a raid1 array&lt;br /&gt;
===Diagnostic===&lt;br /&gt;
Some useful commands to inspect the raid situation:&lt;br /&gt;
 # From what&#039;s currently assembled:&lt;br /&gt;
 cat /proc/mdstat&lt;br /&gt;
 mdadm --detail --scan&lt;br /&gt;
 mdadm --detail /dev/md1&lt;br /&gt;
 # From what&#039;s available as raid partitions&lt;br /&gt;
 mdadm --examine --scan&lt;br /&gt;
 mdadm --examine /dev/hda5&lt;br /&gt;
&lt;br /&gt;
===Repairing a degraded array===&lt;br /&gt;
Later when we&#039;ll be able to integrate /dev/hda3 we&#039;ll do:&lt;br /&gt;
 mdadm /dev/md0 --add /dev/hda3&lt;br /&gt;
Then prepare for reboot&lt;br /&gt;
===/boot===&lt;br /&gt;
Here is one example:&lt;br /&gt;
&amp;lt;br&amp;gt;Initially /boot was not on raid1 but as now it&#039;s possible with grub I did so.&lt;br /&gt;
&amp;lt;br&amp;gt;I had /boot=/dev/hda1 and /boot-img=/dev/hdd1 and I did sth like:&lt;br /&gt;
 umount /dev/hdd1&lt;br /&gt;
 mdadm --create /dev/md1 --raid-devices=2 --level=raid1 missing /dev/hdd1&lt;br /&gt;
 mount /dev/md1 /boot-img&lt;br /&gt;
 cp -a /boot/* /boot-img&lt;br /&gt;
 umount /boot&lt;br /&gt;
 umount /boot-img&lt;br /&gt;
 mdadm /dev/md1 --add /dev/hda1&lt;br /&gt;
 vi /etc/fstab #/dev/md0 /boot ... and delete /boot-img entry&lt;br /&gt;
 grub-install &amp;quot;(hd1)&amp;quot;&lt;br /&gt;
 grub-install &amp;quot;(hd0)&amp;quot;&lt;br /&gt;
 dpkg-reconfigure linux-image-...&lt;br /&gt;
 mdadm --examine --scan |grep md1&amp;gt;&amp;gt; /etc/mdadm.conf&lt;br /&gt;
 reboot&lt;br /&gt;
===Changing super-minor===&lt;br /&gt;
During the process I wanted to change the number associated to an array (/dev/mdX):&lt;br /&gt;
&amp;lt;br&amp;gt;Suppose /dev/md3 = /dev/hda5+/dev/hdd5&lt;br /&gt;
&amp;lt;br&amp;gt;And we want /dev/md2 = /dev/hda5+/dev/hdd5&lt;br /&gt;
 mdadm --stop /dev/md3&lt;br /&gt;
 mdadm --assemble /dev/md2 /dev/hda5 /dev/hdd5&lt;br /&gt;
Then prepare for reboot&lt;br /&gt;
&lt;br /&gt;
===Yaird===&lt;br /&gt;
To rebuild the initrd there are several tools but finally I used yaird which allowed me to preload my IDE driver and get UDMA modes working, which was essential to get sth like 20x faster data transfers!&lt;br /&gt;
&amp;lt;br&amp;gt;I inserted just before the MOUNTDIR keyword which takes care of inserting the needed generic IDE drivers the amd74xx driver I needed for my nVidia chipset:   &lt;br /&gt;
 /etc/yaird/Default.cfg&lt;br /&gt;
 MODULE          amd74xx&lt;br /&gt;
 MOUNTDIR        &amp;quot;/&amp;quot; &amp;quot;/mnt&amp;quot;&lt;br /&gt;
I had also some difficulties when I broke my initrd and had to reboot on a 2.6.14 because apparently kernels pre-2.6.18 cannot generate properly initrd images.&lt;br /&gt;
&amp;lt;br&amp;gt;Hopefully I had a backup of the initrd otherwise try to reboot on a liveCD and chroot or build a new kernel from source without initrd then boot on that one to prepare the initrd.&lt;br /&gt;
&lt;br /&gt;
You can always inspect the initrd by yourself to check things like modules, raid assembly etc, the file is a cpio archive gzip compressed.&lt;br /&gt;
&lt;br /&gt;
===Grub===&lt;br /&gt;
I moved from lilo to grub and installed the first stage on both drives:&lt;br /&gt;
 grub-install &amp;quot;(hd1)&amp;quot;&lt;br /&gt;
 grub-install &amp;quot;(hd0)&amp;quot;&lt;br /&gt;
I edited /etc/kernel-img.conf to have the hooks for Debian kernel automatic installation:&lt;br /&gt;
 postinst_hook = /usr/sbin/update-grub&lt;br /&gt;
 postrm_hook = /usr/sbin/update-grub&lt;br /&gt;
 do_bootloader = no&lt;br /&gt;
I edited /boot/grub/menu.lst and added a fallback directive:&lt;br /&gt;
 default         0&lt;br /&gt;
 fallback        1&lt;br /&gt;
When executing update-grub it creates the following entry:&lt;br /&gt;
 title           Debian GNU/Linux, kernel 2.6.21-2-vserver-k7&lt;br /&gt;
 root            (hd0,0)&lt;br /&gt;
 kernel          /vmlinuz-2.6.21-2-vserver-k7 root=/dev/md0 ro &lt;br /&gt;
 initrd          /initrd.img-2.6.21-2-vserver-k7&lt;br /&gt;
 savedefault&lt;br /&gt;
And I added manually the following one:&lt;br /&gt;
 title           Debian GNU/Linux, kernel 2.6.21-2-vserver-k7 (hd1)&lt;br /&gt;
 root            (hd1,0)&lt;br /&gt;
 kernel          /vmlinuz-2.6.21-2-vserver-k7 root=/dev/md0 ro &lt;br /&gt;
 initrd          /initrd.img-2.6.21-2-vserver-k7&lt;br /&gt;
 savedefault&lt;br /&gt;
But I don&#039;t know how to make it happening automatically via update-grub, anyway in case of a failure of the first harddrive I&#039;ll probably have to reboot manually and Grub is rich enough to allow reconfiguration on-the-fly.&lt;br /&gt;
&amp;lt;br&amp;gt;That&#039;s the major reason why I moved away from lilo.&lt;br /&gt;
&lt;br /&gt;
==How to switch a Debian system on software RAID 1 (mirroring) (OLD)==&lt;br /&gt;
&lt;br /&gt;
Here is how to switch your root (/) filesystem on RAID 1:&lt;br /&gt;
&lt;br /&gt;
Have 2 same disks, let&#039;s say hda and hdc (yep, put them on different IDE controllers!)&lt;br /&gt;
&amp;lt;br&amp;gt;Create a specific small partition for /boot at the very beginning of the first disk (hda) because some (most?) bootloaders don&#039;t understand RAID.&lt;br /&gt;
&amp;lt;br&amp;gt;Mine is hda1-&amp;gt;/boot hda2-&amp;gt;swap hda3-&amp;gt;/&lt;br /&gt;
&amp;lt;br&amp;gt;Install Debian as usual on hda&lt;br /&gt;
&amp;lt;br&amp;gt;Format hdc with a same partition as the / on hda, it&#039;ll be the RAID mirror of /&lt;br /&gt;
&amp;lt;br&amp;gt;My second disk (same vendor, same size) didn&#039;t have the same geometry (C/H/S) but after dd if=/dev/zero of=/dev/hdc bs=512 count=1 fdisk used the same geometry...&lt;br /&gt;
&amp;lt;br&amp;gt;Now it is the same as hda: hdc1-&amp;gt;/boot-img hdc2-&amp;gt;swap hdc3-&amp;gt;/&lt;br /&gt;
 apt-get install initrd-tools raidtools2 mdadm (decline offer to start RAID at boot time)&lt;br /&gt;
Create /etc/raidtab:&lt;br /&gt;
 raiddev                 /dev/md0&lt;br /&gt;
 raid-level              1&lt;br /&gt;
 nr-raid-disks           2&lt;br /&gt;
 nr-spare-disks          0&lt;br /&gt;
 persistent-superblock   1&lt;br /&gt;
 device                  /dev/hdc3&lt;br /&gt;
 raid-disk               0&lt;br /&gt;
 device                  /dev/hda3&lt;br /&gt;
 failed-disk             1&lt;br /&gt;
So the actual / partition is declared as &amp;quot;broken&amp;quot; for the RAID&lt;br /&gt;
&amp;lt;br&amp;gt;Create the RAID:&lt;br /&gt;
 mkraid /dev/md0 (it will say disk1: failed)&lt;br /&gt;
 mkfs.ext3 /dev/md0&lt;br /&gt;
 mount -v /dev/md0 /mnt/root&lt;br /&gt;
Copy the / content:&lt;br /&gt;
 cd /&lt;br /&gt;
 find . -xdev | cpio -pm /mnt/root&lt;br /&gt;
Prepare to reboot on the RAID:&lt;br /&gt;
&amp;lt;br&amp;gt;Edit /etc/mkinitrd/mkinitrd.conf:&lt;br /&gt;
 ROOT=probe -&amp;gt; ROOT=/dev/md0&lt;br /&gt;
&lt;br /&gt;
 mkinitrd -o /boot/initrd.img-raid&lt;br /&gt;
Edit /mnt/root/etc/fstab:&lt;br /&gt;
 /dev/md0 / ext3 defaults,errors=remount-ro 0 1&lt;br /&gt;
Edit /etc/lilo.conf:&lt;br /&gt;
 image=/boot/vmlinuz...&lt;br /&gt;
 label=LinuxRAID&lt;br /&gt;
 root=/dev/md0&lt;br /&gt;
 read-only&lt;br /&gt;
 initrd=/boot/initrd.img-raid&lt;br /&gt;
&lt;br /&gt;
 umount /dev/md0&lt;br /&gt;
 raidstop /dev/md0&lt;br /&gt;
 lilo&lt;br /&gt;
 reboot&lt;br /&gt;
Restore the &amp;quot;broken&amp;quot; RAID:&lt;br /&gt;
 cat /proc/mdstat: we see only one disk&lt;br /&gt;
 raidhotadd /dev/md0 /dev/hda3&lt;br /&gt;
Now the system is synchonizing the &amp;quot;new&amp;quot; RAID partition&lt;br /&gt;
 watch cat /proc/mdstat&lt;br /&gt;
Prepare for next reboot:&lt;br /&gt;
&amp;lt;br&amp;gt;Edit /etc/fstab:&lt;br /&gt;
 failed-disk -&amp;gt; raid-disk&lt;br /&gt;
 mkinitrd -o /boot/initrd.img-raid&lt;br /&gt;
 lilo&lt;br /&gt;
 reboot&lt;br /&gt;
==Automatic watching==&lt;br /&gt;
 dpkg-reconfigure mdadm -&amp;gt; accept mdadm survey daemon and give user who should get alert emails&lt;br /&gt;
Simulating RAID 0 (striping) for the swap:&lt;br /&gt;
&amp;lt;br&amp;gt;Simply give the same priority to both swap partitions:&lt;br /&gt;
 /dev/hda2 swap swap defaults,pri=1 0 0&lt;br /&gt;
 /dev/hdc2 swap swap defaults,pri=1 0 0&lt;br /&gt;
&lt;br /&gt;
== Fresh install debian ==&lt;br /&gt;
[[http://www200.pair.com/mecham/raid/raid1.html | A good starting point ]]&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
Don&#039;t simply dd the MBR from hda to hdc otherwise lilo will complain about a timestamp error, actually that&#039;s because now both disks got the same ID number.&lt;br /&gt;
&amp;lt;br&amp;gt;You can mount the initrd image to check if it contains well the RAID instructions:&lt;br /&gt;
 mount /boot/initrd.img-raid /mnt/disk -o loop,ro&lt;br /&gt;
/mnt/disk/script should contain a last line with mdadm&lt;br /&gt;
&amp;lt;br&amp;gt;check the end of the line, first time only /dev/hdc3 is mentioned, second time /dev/hda3 should also be present (or the system will be mounted again in degraded mode)&lt;br /&gt;
&amp;lt;br&amp;gt;If reboot fails:&lt;br /&gt;
Boot on a Knoppix&lt;br /&gt;
 modprobe raid1&lt;br /&gt;
 mdadm --assemble /dev/md0 /dev/hdd3 /dev/hda3&lt;br /&gt;
 mount /dev/md0 /mnt/xxx&lt;br /&gt;
 chroot /mnt/xxx&lt;br /&gt;
 mount also /proc /boot etc&lt;br /&gt;
 mkinitrd -o /boot/initrd.img-raid &amp;lt;kernel version&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Useful commands==&lt;br /&gt;
&lt;br /&gt;
* Diagnostics&lt;br /&gt;
 mdadm -D /dev/mdXX&lt;br /&gt;
 mdadm -E /dev/hdXX&lt;br /&gt;
 cat /proc/mdstat&lt;br /&gt;
* Add&lt;br /&gt;
 mdadm /dev/mdXX -a /dev/hdXX&lt;/div&gt;</summary>
		<author><name>Dorian</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Debian_Soft_Raid&amp;diff=6055</id>
		<title>Debian Soft Raid</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Debian_Soft_Raid&amp;diff=6055"/>
		<updated>2010-01-07T07:52:25Z</updated>

		<summary type="html">&lt;p&gt;Dorian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==How to switch a Debian system on software RAID 1 (mirroring)==&lt;br /&gt;
===Intro===&lt;br /&gt;
Here are just some quick notes to update this page as now everything can be done relatively easily with just mdadm.&lt;br /&gt;
&amp;lt;br&amp;gt;A very interesting page: http://www200.pair.com/mecham/raid/raid1-degraded-etch.html&lt;br /&gt;
&amp;lt;br&amp;gt;It helps getting familiar with the concepts.&lt;br /&gt;
&amp;lt;br&amp;gt;Here it&#039;s not a step-by-step anymore as the first time I used the old method described later and I used the new mdadm-only way to replace a broken drive, build new raid1 arrays as the new drive was larger (and the old smaller than the surviving one) and a raid1 on the /boot and moving from lilo to grub.&lt;br /&gt;
&lt;br /&gt;
===Creating degraded array===&lt;br /&gt;
Here we&#039;re missing /dev/hda3 so we start with only /dev/hdd3:&lt;br /&gt;
 mdadm --create /dev/md0 --raid-devices=2 --level=raid1 missing /dev/hdd3&lt;br /&gt;
And to get it properly set after reboot, we can create mdadm.conf:&lt;br /&gt;
 echo DEVICE partitions &amp;gt; /etc/mdadm/mdadm.conf&lt;br /&gt;
 mdadm --examine --scan &amp;gt;&amp;gt; /etc/mdadm/mdadm.conf&lt;br /&gt;
Edit and check the file manually...&lt;br /&gt;
&amp;lt;br&amp;gt;Then prepare for reboot&lt;br /&gt;
===Preparing for reboot===&lt;br /&gt;
During the configuration, every time we want to reboot, we&#039;ve to make sure to:&lt;br /&gt;
* have the intended partition layout (fdisk)&lt;br /&gt;
* have the intended partitions mounted on the intended mountpoints (mount)&lt;br /&gt;
* have /etc/fstab reflecting the current mounts&lt;br /&gt;
* have /etc/mdadm/mdadm.conf reflecting the current Raid arrays&lt;br /&gt;
* have an initrd reflecting the current situation:&lt;br /&gt;
 dpkg-reconfigure linux-image-...&lt;br /&gt;
This is true also after having added the 2nd partition to a raid1 array&lt;br /&gt;
===Diagnostic===&lt;br /&gt;
Some useful commands to inspect the raid situation:&lt;br /&gt;
 # From what&#039;s currently assembled:&lt;br /&gt;
 cat /proc/mdstat&lt;br /&gt;
 mdadm --detail --scan&lt;br /&gt;
 mdadm --detail /dev/md1&lt;br /&gt;
 # From what&#039;s available as raid partitions&lt;br /&gt;
 mdadm --examine --scan&lt;br /&gt;
 mdadm --examine /dev/hda5&lt;br /&gt;
&lt;br /&gt;
===Repairing a degraded array===&lt;br /&gt;
Later when we&#039;ll be able to integrate /dev/hda3 we&#039;ll do:&lt;br /&gt;
 mdadm /dev/md0 --add /dev/hda3&lt;br /&gt;
Then prepare for reboot&lt;br /&gt;
===/boot===&lt;br /&gt;
Here is one example:&lt;br /&gt;
&amp;lt;br&amp;gt;Initially /boot was not on raid1 but as now it&#039;s possible with grub I did so.&lt;br /&gt;
&amp;lt;br&amp;gt;I had /boot=/dev/hda1 and /boot-img=/dev/hdd1 and I did sth like:&lt;br /&gt;
 umount /dev/hdd1&lt;br /&gt;
 mdadm --create /dev/md1 --raid-devices=2 --level=raid1 missing /dev/hdd1&lt;br /&gt;
 mount /dev/md1 /boot-img&lt;br /&gt;
 cp -a /boot/* /boot-img&lt;br /&gt;
 umount /boot&lt;br /&gt;
 umount /boot-img&lt;br /&gt;
 mdadm /dev/md1 --add /dev/hda1&lt;br /&gt;
 vi /etc/fstab #/dev/md0 /boot ... and delete /boot-img entry&lt;br /&gt;
 grub-install &amp;quot;(hd1)&amp;quot;&lt;br /&gt;
 grub-install &amp;quot;(hd0)&amp;quot;&lt;br /&gt;
 dpkg-reconfigure linux-image-...&lt;br /&gt;
 mdadm --examine --scan |grep md1&amp;gt;&amp;gt; /etc/mdadm.conf&lt;br /&gt;
 reboot&lt;br /&gt;
===Changing super-minor===&lt;br /&gt;
During the process I wanted to change the number associated to an array (/dev/mdX):&lt;br /&gt;
&amp;lt;br&amp;gt;Suppose /dev/md3 = /dev/hda5+/dev/hdd5&lt;br /&gt;
&amp;lt;br&amp;gt;And we want /dev/md2 = /dev/hda5+/dev/hdd5&lt;br /&gt;
 mdadm --stop /dev/md3&lt;br /&gt;
 mdadm --assemble /dev/md2 /dev/hda5 /dev/hdd5&lt;br /&gt;
Then prepare for reboot&lt;br /&gt;
&lt;br /&gt;
===Yaird===&lt;br /&gt;
To rebuild the initrd there are several tools but finally I used yaird which allowed me to preload my IDE driver and get UDMA modes working, which was essential to get sth like 20x faster data transfers!&lt;br /&gt;
&amp;lt;br&amp;gt;I inserted just before the MOUNTDIR keyword which takes care of inserting the needed generic IDE drivers the amd74xx driver I needed for my nVidia chipset:   &lt;br /&gt;
 /etc/yaird/Default.cfg&lt;br /&gt;
 MODULE          amd74xx&lt;br /&gt;
 MOUNTDIR        &amp;quot;/&amp;quot; &amp;quot;/mnt&amp;quot;&lt;br /&gt;
I had also some difficulties when I broke my initrd and had to reboot on a 2.6.14 because apparently kernels pre-2.6.18 cannot generate properly initrd images.&lt;br /&gt;
&amp;lt;br&amp;gt;Hopefully I had a backup of the initrd otherwise try to reboot on a liveCD and chroot or build a new kernel from source without initrd then boot on that one to prepare the initrd.&lt;br /&gt;
&lt;br /&gt;
You can always inspect the initrd by yourself to check things like modules, raid assembly etc, the file is a cpio archive gzip compressed.&lt;br /&gt;
&lt;br /&gt;
===Grub===&lt;br /&gt;
I moved from lilo to grub and installed the first stage on both drives:&lt;br /&gt;
 grub-install &amp;quot;(hd1)&amp;quot;&lt;br /&gt;
 grub-install &amp;quot;(hd0)&amp;quot;&lt;br /&gt;
I edited /etc/kernel-img.conf to have the hooks for Debian kernel automatic installation:&lt;br /&gt;
 postinst_hook = /usr/sbin/update-grub&lt;br /&gt;
 postrm_hook = /usr/sbin/update-grub&lt;br /&gt;
 do_bootloader = no&lt;br /&gt;
I edited /boot/grub/menu.lst and added a fallback directive:&lt;br /&gt;
 default         0&lt;br /&gt;
 fallback        1&lt;br /&gt;
When executing update-grub it creates the following entry:&lt;br /&gt;
 title           Debian GNU/Linux, kernel 2.6.21-2-vserver-k7&lt;br /&gt;
 root            (hd0,0)&lt;br /&gt;
 kernel          /vmlinuz-2.6.21-2-vserver-k7 root=/dev/md0 ro &lt;br /&gt;
 initrd          /initrd.img-2.6.21-2-vserver-k7&lt;br /&gt;
 savedefault&lt;br /&gt;
And I added manually the following one:&lt;br /&gt;
 title           Debian GNU/Linux, kernel 2.6.21-2-vserver-k7 (hd1)&lt;br /&gt;
 root            (hd1,0)&lt;br /&gt;
 kernel          /vmlinuz-2.6.21-2-vserver-k7 root=/dev/md0 ro &lt;br /&gt;
 initrd          /initrd.img-2.6.21-2-vserver-k7&lt;br /&gt;
 savedefault&lt;br /&gt;
But I don&#039;t know how to make it happening automatically via update-grub, anyway in case of a failure of the first harddrive I&#039;ll probably have to reboot manually and Grub is rich enough to allow reconfiguration on-the-fly.&lt;br /&gt;
&amp;lt;br&amp;gt;That&#039;s the major reason why I moved away from lilo.&lt;br /&gt;
&lt;br /&gt;
==How to switch a Debian system on software RAID 1 (mirroring) (OLD)==&lt;br /&gt;
&lt;br /&gt;
Here is how to switch your root (/) filesystem on RAID 1:&lt;br /&gt;
&lt;br /&gt;
Have 2 same disks, let&#039;s say hda and hdc (yep, put them on different IDE controllers!)&lt;br /&gt;
&amp;lt;br&amp;gt;Create a specific small partition for /boot at the very beginning of the first disk (hda) because some (most?) bootloaders don&#039;t understand RAID.&lt;br /&gt;
&amp;lt;br&amp;gt;Mine is hda1-&amp;gt;/boot hda2-&amp;gt;swap hda3-&amp;gt;/&lt;br /&gt;
&amp;lt;br&amp;gt;Install Debian as usual on hda&lt;br /&gt;
&amp;lt;br&amp;gt;Format hdc with a same partition as the / on hda, it&#039;ll be the RAID mirror of /&lt;br /&gt;
&amp;lt;br&amp;gt;My second disk (same vendor, same size) didn&#039;t have the same geometry (C/H/S) but after dd if=/dev/zero of=/dev/hdc bs=512 count=1 fdisk used the same geometry...&lt;br /&gt;
&amp;lt;br&amp;gt;Now it is the same as hda: hdc1-&amp;gt;/boot-img hdc2-&amp;gt;swap hdc3-&amp;gt;/&lt;br /&gt;
 apt-get install initrd-tools raidtools2 mdadm (decline offer to start RAID at boot time)&lt;br /&gt;
Create /etc/raidtab:&lt;br /&gt;
 raiddev                 /dev/md0&lt;br /&gt;
 raid-level              1&lt;br /&gt;
 nr-raid-disks           2&lt;br /&gt;
 nr-spare-disks          0&lt;br /&gt;
 persistent-superblock   1&lt;br /&gt;
 device                  /dev/hdc3&lt;br /&gt;
 raid-disk               0&lt;br /&gt;
 device                  /dev/hda3&lt;br /&gt;
 failed-disk             1&lt;br /&gt;
So the actual / partition is declared as &amp;quot;broken&amp;quot; for the RAID&lt;br /&gt;
&amp;lt;br&amp;gt;Create the RAID:&lt;br /&gt;
 mkraid /dev/md0 (it will say disk1: failed)&lt;br /&gt;
 mkfs.ext3 /dev/md0&lt;br /&gt;
 mount -v /dev/md0 /mnt/root&lt;br /&gt;
Copy the / content:&lt;br /&gt;
 cd /&lt;br /&gt;
 find . -xdev | cpio -pm /mnt/root&lt;br /&gt;
Prepare to reboot on the RAID:&lt;br /&gt;
&amp;lt;br&amp;gt;Edit /etc/mkinitrd/mkinitrd.conf:&lt;br /&gt;
 ROOT=probe -&amp;gt; ROOT=/dev/md0&lt;br /&gt;
&lt;br /&gt;
 mkinitrd -o /boot/initrd.img-raid&lt;br /&gt;
Edit /mnt/root/etc/fstab:&lt;br /&gt;
 /dev/md0 / ext3 defaults,errors=remount-ro 0 1&lt;br /&gt;
Edit /etc/lilo.conf:&lt;br /&gt;
 image=/boot/vmlinuz...&lt;br /&gt;
 label=LinuxRAID&lt;br /&gt;
 root=/dev/md0&lt;br /&gt;
 read-only&lt;br /&gt;
 initrd=/boot/initrd.img-raid&lt;br /&gt;
&lt;br /&gt;
 umount /dev/md0&lt;br /&gt;
 raidstop /dev/md0&lt;br /&gt;
 lilo&lt;br /&gt;
 reboot&lt;br /&gt;
Restore the &amp;quot;broken&amp;quot; RAID:&lt;br /&gt;
 cat /proc/mdstat: we see only one disk&lt;br /&gt;
 raidhotadd /dev/md0 /dev/hda3&lt;br /&gt;
Now the system is synchonizing the &amp;quot;new&amp;quot; RAID partition&lt;br /&gt;
 watch cat /proc/mdstat&lt;br /&gt;
Prepare for next reboot:&lt;br /&gt;
&amp;lt;br&amp;gt;Edit /etc/fstab:&lt;br /&gt;
 failed-disk -&amp;gt; raid-disk&lt;br /&gt;
 mkinitrd -o /boot/initrd.img-raid&lt;br /&gt;
 lilo&lt;br /&gt;
 reboot&lt;br /&gt;
==Automatic watching==&lt;br /&gt;
 dpkg-reconfigure mdadm -&amp;gt; accept mdadm survey daemon and give user who should get alert emails&lt;br /&gt;
Simulating RAID 0 (striping) for the swap:&lt;br /&gt;
&amp;lt;br&amp;gt;Simply give the same priority to both swap partitions:&lt;br /&gt;
 /dev/hda2 swap swap defaults,pri=1 0 0&lt;br /&gt;
 /dev/hdc2 swap swap defaults,pri=1 0 0&lt;br /&gt;
&lt;br /&gt;
== Fresh install debian ==&lt;br /&gt;
[[A good starting point | http://www200.pair.com/mecham/raid/raid1.html]]&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
Don&#039;t simply dd the MBR from hda to hdc otherwise lilo will complain about a timestamp error, actually that&#039;s because now both disks got the same ID number.&lt;br /&gt;
&amp;lt;br&amp;gt;You can mount the initrd image to check if it contains well the RAID instructions:&lt;br /&gt;
 mount /boot/initrd.img-raid /mnt/disk -o loop,ro&lt;br /&gt;
/mnt/disk/script should contain a last line with mdadm&lt;br /&gt;
&amp;lt;br&amp;gt;check the end of the line, first time only /dev/hdc3 is mentioned, second time /dev/hda3 should also be present (or the system will be mounted again in degraded mode)&lt;br /&gt;
&amp;lt;br&amp;gt;If reboot fails:&lt;br /&gt;
Boot on a Knoppix&lt;br /&gt;
 modprobe raid1&lt;br /&gt;
 mdadm --assemble /dev/md0 /dev/hdd3 /dev/hda3&lt;br /&gt;
 mount /dev/md0 /mnt/xxx&lt;br /&gt;
 chroot /mnt/xxx&lt;br /&gt;
 mount also /proc /boot etc&lt;br /&gt;
 mkinitrd -o /boot/initrd.img-raid &amp;lt;kernel version&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Useful commands==&lt;br /&gt;
&lt;br /&gt;
* Diagnostics&lt;br /&gt;
 mdadm -D /dev/mdXX&lt;br /&gt;
 mdadm -E /dev/hdXX&lt;br /&gt;
 cat /proc/mdstat&lt;br /&gt;
* Add&lt;br /&gt;
 mdadm /dev/mdXX -a /dev/hdXX&lt;/div&gt;</summary>
		<author><name>Dorian</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=4431</id>
		<title>Belgian eID</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Belgian_eID&amp;diff=4431"/>
		<updated>2008-05-17T11:01:39Z</updated>

		<summary type="html">&lt;p&gt;Dorian: /* News */&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;
==News==&lt;br /&gt;
* 2008-05-17 : Liège marie de quartier du Tier-à-liège this saturday (Yes the office is open on saturday !) We received our new EID card, No more paper to sign (Annex 3 and 10) for revoking a certificate. (Maybe this is a bug in the administration ... The girls does&#039;nt know the difference between the 2 certificate (auth. and sign). Worse she does&#039;nt  know the signification ... and the top of the top ... Event on the paper you receive from the administration, it is clearly writen &#039;.. 2 certificate : 1 for signing and 1 for authentification&#039; BUT on the screen of the computer&#039;administration for the revokation : &#039;révoquer le certificat de signature&#039; et &#039;révoque le certificat de non-répudiation&#039; (sorry french) : Find the mistake ...   &lt;br /&gt;
* 2008-04-23 [http://belsec.skynetblogs.be/post/5799349/belgian-eid-and-the-microsoft-question Belgian EID and the Microsoft question]&lt;br /&gt;
* 2008-04-03..04 European e-ID Card Conference: Current Perspective and Initiatives from around Europe in Government and Business, &#039;&#039;K.U.Leuven&#039;&#039;, €450&lt;br /&gt;
* 2008-03-08 [http://belsec.skynetblogs.be/post/5631741/certipost-the-first-and-only-digital-signatur Certipost the first and only digital signature company approved by our Privacycommission]&lt;br /&gt;
* 2008-02-26 [http://www.levif.be/actualite/technologie/72-63-13441/la-carte-d-identite-electronique-pour-s-enregistrer-sur-ebay-.html The eID to register to eBay.be (fr)] [http://www.lalibre.be/societe/cyber/article/404626/la-carte-d-identite-electronique-permettra-de-s-enregistrer-sur-ebay.html and here (fr)]&lt;br /&gt;
* 2008-02-24 [http://fosdem.org/2008/schedule/events/debian_belgian_eid Presentation of Wouter Verhelst at FOSDEM about &#039;&#039;The Belgian electronic ID card in Debian&#039;&#039;]: [http://samba.grep.be/~wouter/beid-screencast.ogg screencast] and [http://meetings-archive.debian.net/pub/debian-meetings/2008/fosdem/ogg_theora/384x288/The_Belgian_electronic_ID_card_in_Debian___Wouter_Verhelst.ogg video]&lt;br /&gt;
* 2008-02-22 [http://www.datanews.be/fr/news/90-61-16807/belgacom-vend-sa-participation-dans-certipost.html Belgacom sells stake in Certipost (fr)] so now La Poste/De Post owns 100%&lt;br /&gt;
* News Resources:&lt;br /&gt;
** [http://belsec.skynetblogs.be/tag/1/E-ID Belsec blog entries] about the eID&lt;br /&gt;
&lt;br /&gt;
==Officials==&lt;br /&gt;
&lt;br /&gt;
* Major sources of documentation:&amp;lt;br&amp;gt;[http://eid.belgium.be Official eID portal]&amp;lt;br&amp;gt;[http://repository.eid.belgium.be/FR/TechDoc.htm docs on the repository]&amp;lt;br&amp;gt;[http://www.belgium.be/eportal/application?origin=relatedVertical.jsp&amp;amp;event=bea.portal.framework.internal.refresh&amp;amp;pageid=relatedIndexPage&amp;amp;navId=5933&amp;amp;content_category=doc_link_documentation docs on the ePortal]&amp;lt;br&amp;gt;[http://www.ibz.rrn.fgov.be/index.php?id=122&amp;amp;L=0 Direction Générale Institutions &amp;amp; Population], with an interesting news channel &lt;br /&gt;
** Google -&amp;gt; [http://www.belgium.be/zip/fedictmovie/movie_fr.html promotional movie (37Mb)] and [http://www.belgium.be/zip/movieEID_fr/START.html flash presentation]&lt;br /&gt;
** Google -&amp;gt; In the context of the e-Government initiative of the Belgian Federal Government, a project has been defined to design and develop a messaging environment that allows smooth message- based communication information exchange between different governmental institutions. This messaging environment is called the [http://www.belgium.be/zip/ume-api_fr.html Universal Messaging Engine – Version 2 (UME2) (zip)]&lt;br /&gt;
** Google [http://www.google.com/search?q=site:eid.belgium.be+inurl:imported_content_eid deeply], [http://www.google.com/search?q=site:www.belgium.be+inurl:zip deeply], [http://www.google.com/search?q=site:www.ibz.rrn.fgov.be+inurl:eID deeply]...&lt;br /&gt;
* [http://repository.eid.belgium.be/FR/Index.htm Certificates], also &amp;quot;raw&amp;quot; [http://certs.eid.belgium.be/ here] and the [https://stage-pki.belgium.be/ Belgium Root CA] site&lt;br /&gt;
* [http://status.eid.belgium.be/ eID services], check online the status of a certificate and search the delta CRLs&lt;br /&gt;
* [http://crl.eid.belgium.be/ Revocation lists] and [http://ocsp.eid.belgium.be/ OCSP server]&lt;br /&gt;
* [https://readers.eid.belgium.be Help website] for the eID-kits for kids&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://map.eid.belgium.be/fr.html Map of eID applications]&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;
* [http://www.eid-shop.be/language_select/ eID shop], partners &amp;amp; implementations available&lt;br /&gt;
* [http://www.cardreaders.be cardreaders] officially supported&lt;br /&gt;
* [https://ecommunities.belgium.be eCommunities]&lt;br /&gt;
* [http://www.eidcompany.be/ The eID Company], they apparently made most of the eID infrastructure (but I never heard about them since now)&lt;br /&gt;
&lt;br /&gt;
==Specifications==&lt;br /&gt;
* Belgian Electronic Identity Card content&lt;br /&gt;
** [http://www.belgium.be/eportal/ShowDoc/fed_ict/imported_content/pdf/Belgian_Electronic_Identity_Card_content_v2.2_FR.pdf?contentHome=entapp.BEA_personalization.eGovWebCacheDocumentManager.fr v2.2 (pdf)] from [http://eid.belgium.be Official eID portal]&lt;br /&gt;
** [http://web.archive.org/web/*/http://www.rijksregister.fgov.be/cie/specifications_techniques/belgian_electronic_identity_card_content_v2.8.a.pdf v2.8a (pdf)] from [http://www.archive.org WaybackMachine], found ref in [http://csrc.nist.gov/publications/nistir/ir7284/nistir-7284.pdf this NIST document (pdf)]&amp;lt;br&amp;gt;Ok the document actually [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/5%20aspects%20techniques/fr/belgian_electronic_identity_card_content_v2.8.a.pdf moved to the new website]&lt;br /&gt;
*** That version skips v2.2 in the Document Change History, very strange...&lt;br /&gt;
* Description of the Belpic EID-version numbering&lt;br /&gt;
** [http://www.belgium.be/eportal/ShowDoc/fed_ict/imported_content/pdf/eID-version_numbering_v1_6_8_FR.pdf?contentHome=entapp.BEA_personalization.eGovWebCacheDocumentManager.fr v1.6.8] from [http://eid.belgium.be Official eID portal]&lt;br /&gt;
* Public User Specification BELPIC Application&lt;br /&gt;
** [http://www.belgium.be/zip/IdentityMiddlewareSpecs.zip V2.0 (pdf in zip)]&lt;br /&gt;
** I found [http://www.mkik.hu/download.php?id=726 this doc] on the [http://www.mkik.hu/index.php?id=634 Hungarian Chamber of Commerce &amp;amp; Industry], even in a [http://www.mkik.hu/download.php?id=727 version partly translated in hungarian]&amp;lt;br&amp;gt;The end of that document is the Public User Specification BELPIC Application but badly formatted&amp;lt;br&amp;gt;Apparently it ended up on this site as [http://www.mkik.hu/download.php?id=724 part of a publication for the European institutions]&lt;br /&gt;
* EID-Readers technical compatibility&lt;br /&gt;
** [http://www.belgium.be/eportal/ShowDoc/fed_ict/imported_content/pdf/Readers_technical_compatibility_v2.7.3_FR.pdf?contentHome=entapp.BEA_personalization.eGovWebCacheDocumentManager.fr  v2.7.3 (pdf)] from [http://eid.belgium.be Official eID portal]&lt;br /&gt;
** [http://www.foo.be/eID/opensc-belgium/BEID-ReaderSpecs-v2.7.5.pdf v2.7.5 (pdf)]&lt;br /&gt;
* Belgian Electronic Identity Card Middleware Programmers Guide&lt;br /&gt;
** [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/5%20aspects%20techniques/fr/programmers_guide_v1.1.pdf v1.1 (pdf)]&lt;br /&gt;
** [http://www.belgium.be/zip/IdentityMiddlewareSpecs.zip v1.4 (pdf in zip)]&lt;br /&gt;
* Belgian eID Toolkit Developer&#039;s guide&lt;br /&gt;
** [http://www.belgium.be/zip/IdentityMiddlewareSpecs.zip v1.0i (pdf in zip)]&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;
* [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://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 (nl)] ([http://www.microsoft.com/belux/fr/eid/ or (fr)]), just an old marketing buzz? (I wouldn&#039;t complain...)&lt;br /&gt;
* [http://homes.esat.kuleuven.be/~decockd/site/EidCards/belpic/mySlides/belgian.eid.card.technical.overview.pdf Belgian eID Card Technicalities (pdf)] by Danny de Cock, a MUST to read if you want to know all the gory details about the eID!&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;
[https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/EidForums/ForumEidCards0014 According to Danny de Cock] you can revoke them by phone via the eID card stop service: call +32-2-518.21.16 or +32.2.518.21.17,in French or Dutch, respectively (there is a 7-day period prior to definitive revocation, I&#039;m not sure how secure is the procedure...)&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. &amp;lt;br&amp;gt;&#039;&#039;UPDATE&#039;&#039;: [https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/EidForums/ForumEidCards0015 some discussions here]&amp;lt;br&amp;gt;&#039;&#039;UPDATE&#039;&#039;: Public user specification BELPIC application v2.0 mention 2 different PINs with their own ids (01 for auth, 04 for non-repud) and [https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/EidForums/ForumEidCards0067 according to Danny] the new cards will have 2 PINs&lt;br /&gt;
** Better than 4 digits (&amp;amp; 3 attempts so 3 chances over 10000)&amp;lt;br&amp;gt;&#039;&#039;UPDATE&#039;&#039; In fact we can change the PIN to up to a 12-digit value.&lt;br /&gt;
** Probably they limited themselves to one single 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 [http://scienceblogs.com/cognitivedaily/2007/02/is_17_the_most_random_number.php generate random] PINs? ;-)&amp;lt;br&amp;gt;&#039;&#039;UPDATE&#039;&#039;: Actually you get only half of the PUK, 6 digits, and you need to go to the municipality to have your eID card unblocked... This unblocking consists of sending 12 PUK digits to your eID card: you provide 6 PUK digits, and the National Register provides the other 6... I.e., it is impossible for a citizen to unblock his/her eID card without presenting him/herself to the municipality... [https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/EidForums/ForumEidCards0067 Thanks for the info Danny]!&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...&amp;lt;br&amp;gt;You can import Belgium Root CA signed by GlobalSign Root CA [http://certs.eid.belgium.be/ here (the belgiumrs*.crt)]&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;
* And what about [http://www.ibz.rrn.fgov.be/fileadmin/user_upload/CI/eID/fr/8_documentation/communique_de_presse/presse_150208_2.pdf administrative errors]? ;-)&lt;br /&gt;
&lt;br /&gt;
==Linux: Drivers==&lt;br /&gt;
If you want to try also [https://readers.eid.belgium.be/index.cfm?Content_ID=8515371 make sure you&#039;re using Linux] :-D&lt;br /&gt;
&lt;br /&gt;
I&#039;m using the [[IDream ID-SMID01 SmartCard reader]], bought for 10€&lt;br /&gt;
&amp;lt;br&amp;gt;So the card is accessed via the USB reader, handled by the libccid, used by the pcscd daemon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pcsc_scan&lt;br /&gt;
 Reader 0: iDream ID-SMID01 00 00&lt;br /&gt;
  Card state: Card inserted, &lt;br /&gt;
  ATR: 3B 98 13 40 0A A5 03 01 01 01 AD 13 11&lt;br /&gt;
&lt;br /&gt;
ATR: 3B 98 13 40 0A A5 03 01 01 01 AD 13 11&lt;br /&gt;
+ TS = 3B --&amp;gt; Direct Convention&lt;br /&gt;
+ T0 = 98, Y(1): 1001, K: 8 (historical bytes)&lt;br /&gt;
  TA(1) = 13 --&amp;gt; Fi=372, Di=4, 93 cycles/ETU (38400 bits/s at 3.57 MHz)&lt;br /&gt;
  TD(1) = 40 --&amp;gt; Y(i+1) = 0100, Protocol T = 0 &lt;br /&gt;
-----&lt;br /&gt;
  TC(2) = 0A --&amp;gt; Work waiting time: 960 x 10 x (Fi/F)&lt;br /&gt;
+ Historical bytes: A5 03 01 01 01 AD 13 11&lt;br /&gt;
  Category indicator byte: A5 (proprietary format)&lt;br /&gt;
&lt;br /&gt;
Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):&lt;br /&gt;
3B 98 13 40 0A A5 03 01 01 01 AD 13 11&lt;br /&gt;
        Belgium Electronic ID card&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux: Government Middleware==&lt;br /&gt;
===Installation===&lt;br /&gt;
The Belgian government is providing a Linux middleware to access the eID.&lt;br /&gt;
&amp;lt;br&amp;gt;The sources are accessible [http://www.belgium.be/zip/eid_datacapture_fr.html here (fr)] or [http://www.belgium.be/zip/eid_datacapture_fr.html there (nl)]&lt;br /&gt;
&amp;lt;br&amp;gt;But thanks to Wouter Verhelst, there are also Debian packages (2.6.0-3 in Lenny as I&#039;m writing):&lt;br /&gt;
&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;
Some interesting documentation once it&#039;s installed: /usr/share/doc/libbeidlibopensc2/README.Debian&lt;br /&gt;
&lt;br /&gt;
A short introduction to the middleware is available [http://www.belgium.be/zip/middleware_Linux_FR.pdf here (fr, pdf)] or [http://www.belgium.be/zip/middleware_Linux_NL.pdf here (nl, pdf)]&lt;br /&gt;
===Belpic version of OpenSC===&lt;br /&gt;
The middleware is a modified version of OpenSC, talking to pcscd.&lt;br /&gt;
&amp;lt;br&amp;gt;I recently saw that my ~/.xsession-errors logfile was full of &#039;&#039;Error: can&#039;t open /var/run/openct/status...&#039;&#039;&amp;lt;br&amp;gt;It happens whenever icedove/iceweasel are open (so when the libbeidpkcs11.so is loaded) I found a [https://bugs.launchpad.net/ubuntu/+source/belpic/+bug/70442 bugreport on Ubuntu] and the proposed fix works so I opened a Debian bugreport: [http://bugs.debian.org/469485 #469485]:&lt;br /&gt;
&lt;br /&gt;
OpenSC has support for three driver types : PCSC, OpenCT and CT-API. Belpic only needs PC/SC, and will produce errors/warnings if you leave support for OpenCT enabled.&lt;br /&gt;
&lt;br /&gt;
Edit /etc/beidbase.conf, and insert a statement that limits the use of drivers to pcsc. Right before the reader_driver config feels like an OK place to do this :&lt;br /&gt;
&lt;br /&gt;
 ## specify driver family pcsc.&lt;br /&gt;
 # Others (openct, ..) are not needed for Belpic and&lt;br /&gt;
 # may produce errors/warnings&lt;br /&gt;
 &lt;br /&gt;
        reader_drivers = pcsc ;&lt;br /&gt;
 &lt;br /&gt;
 reader_driver pcsc {&lt;br /&gt;
      ....&lt;br /&gt;
===GUI===&lt;br /&gt;
The GUI application (beidgui) works well, including OCSP communication, showing me that my eID certificates are revoked, excellent!&lt;br /&gt;
&amp;lt;br&amp;gt;You can easily change your PIN here, with a PIN between 4 and 12 digits!&lt;br /&gt;
&amp;lt;br&amp;gt;I don&#039;t remember of having read that PINs bigger than 4-digit were possible...&lt;br /&gt;
&lt;br /&gt;
===beidcrld===&lt;br /&gt;
Part of beid-tools&lt;br /&gt;
&amp;lt;br&amp;gt;It&#039;s an optional daemon, supposed to download automatically the CRLs.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;TODO&#039;&#039;&#039;: where are those CRLs stored locally? How to check the status? /usr/share/beid/crl&lt;br /&gt;
&lt;br /&gt;
===beidpcscd===&lt;br /&gt;
Part of beid-tools&lt;br /&gt;
&amp;lt;br&amp;gt;It&#039;s an optional daemon.&lt;br /&gt;
&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, Iceweasel &amp;amp; Icedove (through the PKCS#11 module we&#039;ll install later) are constantly speaking with it...&lt;br /&gt;
&amp;lt;br&amp;gt;And if it&#039;s not running, Iceweasel &amp;amp; Icedove will poll every second on that port 2500, no matter if you are really using the eID at that moment or not, erk!&lt;br /&gt;
&lt;br /&gt;
===beid-pkcs11-tool===&lt;br /&gt;
Part of beid-tools&lt;br /&gt;
&amp;lt;br&amp;gt;For a little demo...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ beid-pkcs11-tool --list-slots&lt;br /&gt;
Available slots:&lt;br /&gt;
Slot 0           iDream ID-SMID01 00 00&lt;br /&gt;
  manufacturer:  Zetes&lt;br /&gt;
  hardware ver:  1.0&lt;br /&gt;
  firmware ver:  1.0&lt;br /&gt;
  flags:         token present, removable device, hardware slot&lt;br /&gt;
  token label:   BELPIC (Basic PIN)&lt;br /&gt;
  token manuf:   Axalto&lt;br /&gt;
  token model:   Belgium eID&lt;br /&gt;
  token flags:   rng, PIN initialized, token initialized&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ beid-pkcs11-tool --list-objects&lt;br /&gt;
Private Key Object; RSA 1024 bits&lt;br /&gt;
  label:      Authentication&lt;br /&gt;
  ID:         02&lt;br /&gt;
  Usage:      sign&lt;br /&gt;
Certificate Object, type = X.509 cert&lt;br /&gt;
  label:      Authentication&lt;br /&gt;
  ID:         02&lt;br /&gt;
Public Key Object; RSA 1024 bits&lt;br /&gt;
  label:      Authentication&lt;br /&gt;
  ID:         02&lt;br /&gt;
  Usage:      encrypt, verify&lt;br /&gt;
Certificate Object, type = X.509 cert&lt;br /&gt;
  label:      CA&lt;br /&gt;
  ID:         00&lt;br /&gt;
Public Key Object; RSA 2048 bits&lt;br /&gt;
  label:      CA&lt;br /&gt;
  ID:         04&lt;br /&gt;
  Usage:      encrypt, verify&lt;br /&gt;
Certificate Object, type = X.509 cert&lt;br /&gt;
  label:      Root&lt;br /&gt;
  ID:         00&lt;br /&gt;
Public Key Object; RSA 2048 bits&lt;br /&gt;
  label:      Root&lt;br /&gt;
  ID:         06&lt;br /&gt;
  Usage:      encrypt, verify&lt;br /&gt;
Private Key Object; RSA 1024 bits&lt;br /&gt;
  label:      Signature&lt;br /&gt;
  ID:         03&lt;br /&gt;
  Usage:      sign&lt;br /&gt;
Certificate Object, type = X.509 cert&lt;br /&gt;
  label:      Signature&lt;br /&gt;
  ID:         03&lt;br /&gt;
Public Key Object; RSA 1024 bits&lt;br /&gt;
  label:      Signature&lt;br /&gt;
  ID:         03&lt;br /&gt;
  Usage:      encrypt, verify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ beid-pkcs11-tool --list-mechanisms&lt;br /&gt;
Supported mechanisms:&lt;br /&gt;
  SHA-1, digest&lt;br /&gt;
  MD5, digest&lt;br /&gt;
  RIPEMD160, digest&lt;br /&gt;
  RSA-PKCS, sign, verify, unwrap&lt;br /&gt;
  SHA1-RSA-PKCS, sign, verify&lt;br /&gt;
  MD5-RSA-PKCS, sign, verify&lt;br /&gt;
  RIPEMD160-RSA-PKCS, sign, verify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ beid-pkcs11-tool --test&lt;br /&gt;
C_SeedRandom() and C_GenerateRandom():&lt;br /&gt;
  seems to be OK&lt;br /&gt;
Digests:&lt;br /&gt;
  all 4 digest functions seem to work&lt;br /&gt;
  MD5: OK&lt;br /&gt;
  SHA-1: OK&lt;br /&gt;
  RIPEMD160: OK&lt;br /&gt;
Signatures (currently only RSA signatures)&lt;br /&gt;
  testing key 0 (Authentication) &lt;br /&gt;
QSettings: failed to open file &#039;/etc/qt3/qt_plugins_3.3rc&#039;&lt;br /&gt;
  all 4 signature functions seem to work&lt;br /&gt;
  testing signature mechanisms:&lt;br /&gt;
    RSA-PKCS: OK&lt;br /&gt;
    SHA1-RSA-PKCS: OK&lt;br /&gt;
    MD5-RSA-PKCS: OK&lt;br /&gt;
    RIPEMD160-RSA-PKCS: OK&lt;br /&gt;
  testing key 1 (Signature) with 1 signature mechanism&lt;br /&gt;
    RSA-PKCS: OK&lt;br /&gt;
Verify (currently only for RSA):&lt;br /&gt;
  testing key 0 (Authentication)&lt;br /&gt;
    RSA-PKCS: OK&lt;br /&gt;
    SHA1-RSA-PKCS: OK&lt;br /&gt;
    MD5-RSA-PKCS: OK&lt;br /&gt;
    RIPEMD160-RSA-PKCS: OK&lt;br /&gt;
  testing key 1 (Signature) with 1 mechanism&lt;br /&gt;
    RSA-PKCS: OK&lt;br /&gt;
Key unwrap (RSA)&lt;br /&gt;
  testing key 0 (Authentication)  -- can&#039;t be used to unwrap, skipping&lt;br /&gt;
  testing key 1 (Signature)  -- can&#039;t be used to unwrap, skipping&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===libbeidpkcs11.so===&lt;br /&gt;
It&#039;s a PKCS#11 library which can be used by Firefox/Iceweasel, Thunderbird/Icedove, Iceape, OpenOffice,...&lt;br /&gt;
&amp;lt;br&amp;gt;See below for some tests with those applications.&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 in OpenOffice====&lt;br /&gt;
It is using the same certificate set as firefox/iceweasel so signing in OpenOffice works out-of-the-box on my Debian.&lt;br /&gt;
&amp;lt;br&amp;gt;If not you can still check [http://www.linux.com/articles/57554 this article] to debug your situation.&lt;br /&gt;
&lt;br /&gt;
 File -&amp;gt; Digital Signatures... -&amp;gt; Add...&lt;br /&gt;
&lt;br /&gt;
This works also with the legal &amp;quot;signature&amp;quot; certificate&lt;br /&gt;
&lt;br /&gt;
==Linux: OpenSC Middleware==&lt;br /&gt;
===Installation===&lt;br /&gt;
belpic, the Belgian middleware, is a modified version of OpenSC, let&#039;s try the plain OpenSC:&lt;br /&gt;
 apt-get install opensc&lt;br /&gt;
=&amp;gt; file:///usr/share/doc/opensc/BelgianEid.html&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;OpenSC 0.10.* will include support for the Belgian eID card, except for legally binding signatures (with the so-called Signature key) as this requires a GUI, which is not yet available/implemented. Till that new release please use the &amp;quot;belpic&amp;quot; software available from the belgian state.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Note that you&#039;ve to stop the filter daemon (beidpcscd) first&lt;br /&gt;
===cardos-info===&lt;br /&gt;
Returns the ATR&lt;br /&gt;
 $ cardos-info &lt;br /&gt;
 3b:98:13:40:0a:a5:03:01:01:01:ad:13:11&lt;br /&gt;
 Received (SW1=0x6D, SW2=0x00)&lt;br /&gt;
&lt;br /&gt;
===opensc-tool===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ opensc-tool -a -v # with debug=1 in /etc/opensc/opensc.conf&lt;br /&gt;
[opensc-tool] ctx.c:705:sc_context_create: ===================================&lt;br /&gt;
[opensc-tool] ctx.c:706:sc_context_create: opensc version: 0.11.4&lt;br /&gt;
[opensc-tool] sc.c:196:sc_detect_card_presence: called&lt;br /&gt;
[opensc-tool] sc.c:201:sc_detect_card_presence: returning with: 1&lt;br /&gt;
Connecting to card in reader iDream ID-SMID01 00 00...&lt;br /&gt;
[opensc-tool] card.c:110:sc_connect_card: called&lt;br /&gt;
[opensc-tool] reader-pcsc.c:542:pcsc_connect: After connect protocol = 1&lt;br /&gt;
[opensc-tool] reader-pcsc.c:561:pcsc_connect: Requesting reader features ... &lt;br /&gt;
[opensc-tool] card-belpic.c:988:belpic_init: Belpic V1.4&lt;br /&gt;
[opensc-tool] card-belpic.c:995:belpic_init: &lt;br /&gt;
[opensc-tool] card.c:221:sc_connect_card: card info: Belpic cards, 12002, 0x0&lt;br /&gt;
[opensc-tool] card.c:222:sc_connect_card: returning with: 0&lt;br /&gt;
Using card driver Belpic cards.&lt;br /&gt;
Card ATR:&lt;br /&gt;
3B 98 13 40 0A A5 03 01 01 01 AD 13 11 ;..@.........&lt;br /&gt;
[opensc-tool] card.c:236:sc_disconnect_card: called&lt;br /&gt;
[opensc-tool] card.c:251:sc_disconnect_card: returning with: 0&lt;br /&gt;
[opensc-tool] ctx.c:738:sc_release_context: called&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From the ATR:&lt;br /&gt;
* Component code: A5&lt;br /&gt;
* OS number: 03&lt;br /&gt;
* OS version: 01&lt;br /&gt;
* Softmask number: 01&lt;br /&gt;
* Softmask version: 01&lt;br /&gt;
* Applet version: 1.1&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ opensc-tool -n      &lt;br /&gt;
Belpic cards&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ opensc-tool -f&lt;br /&gt;
3f00 type:  DF, size: 65535&lt;br /&gt;
select[N/A] lock[N/A] delete[N/A] create[N/A] rehab[N/A] inval[N/A] list[N/A] &lt;br /&gt;
[opensc-tool] card.c:343:sc_list_files: returning with: Not supported&lt;br /&gt;
sc_list_files() failed: Not supported&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===opensc-explorer===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ opensc-explorer&lt;br /&gt;
&lt;br /&gt;
#PUK: (max trials: 3, length: 4-12)&lt;br /&gt;
OpenSC [3F00]&amp;gt; verify CHV1 31:31:31:31&lt;br /&gt;
[opensc-explorer] sec.c:201:sc_pin_cmd: returning with: PIN code or key incorrect&lt;br /&gt;
Incorrect code, 2 tries left.&lt;br /&gt;
&lt;br /&gt;
OpenSC [3F00]&amp;gt; verify CHV1 31:32:33:34&lt;br /&gt;
Code correct.&lt;br /&gt;
&lt;br /&gt;
#PUK: (max trials: 12, length: 12)&lt;br /&gt;
OpenSC [3F00]&amp;gt; verify CHV3 31:32:33:34&lt;br /&gt;
[opensc-explorer] sec.c:201:sc_pin_cmd: returning with: PIN code or key incorrect&lt;br /&gt;
Incorrect code, 11 tries left.&lt;br /&gt;
&lt;br /&gt;
#PINreset (max trials: 10, length: 12)&lt;br /&gt;
OpenSC [3F00]&amp;gt; verify CHV2 31:32:33:34&lt;br /&gt;
[opensc-explorer] sec.c:201:sc_pin_cmd: returning with: PIN code or key incorrect&lt;br /&gt;
Incorrect code, 9 tries left.&lt;br /&gt;
&lt;br /&gt;
OpenSC [3F00]&amp;gt; random 100&lt;br /&gt;
00000000: 80 8E DD 53 92 0A FB 12 17 7E 77 49 11 D5 3E 93 ...S.....~wI..&amp;gt;.&lt;br /&gt;
00000010: E7 93 CD C1 D8 AB E2 0E 85 34 44 F0 B2 F4 52 8A .........4D...R.&lt;br /&gt;
00000020: FD 0A 34 8F A1 16 2C 91 85 18 77 83 F4 EC 2F DB ..4...,...w.../.&lt;br /&gt;
00000030: 5D 5A A6 F8 4C 61 21 74 B1 C0 E2 4C FF 7B CF BF ]Z..La!t...L.{..&lt;br /&gt;
00000040: 01 A2 06 CB 41 33 EB 75 2E 86 90 A7 E6 FD 0C 8C ....A3.u........&lt;br /&gt;
00000050: BF 12 CD CE 32 EB 40 89 D7 98 39 78 30 86 AF 52 ....2.@...9x0..R&lt;br /&gt;
00000060: 60 E0 F6 C3                                     `...&lt;br /&gt;
&lt;br /&gt;
OpenSC [3F00]&amp;gt; cd df00&lt;br /&gt;
&lt;br /&gt;
OpenSC [3F00/DF00]&amp;gt; get 5035&lt;br /&gt;
Total of 119 bytes read from 5035 and saved to 3F00_DF00_5035.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can also cat the files:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
OpenSC [3F00]&amp;gt; cd df01&lt;br /&gt;
OpenSC [3F00/DF01]&amp;gt; cd 4033&lt;br /&gt;
OpenSC [3F00/DF01/4033]&amp;gt; cat&lt;br /&gt;
00000000: 01 1E 41 76 65 6E 75 65 20 64 65 20 6C 61 20 43 ..Avenue de la C&lt;br /&gt;
00000010: 6F 75 72 6F 6E 6E 65 20 34 31 20 2F 62 30 32 37 ouronne 41 /b027&lt;br /&gt;
00000020: 02 04 31 30 35 30 03 07 49 78 65 6C 6C 65 73 00 ..1050..Ixelles.&lt;br /&gt;
00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
00000070: 00 00 00 00 00                                  .....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The interpretation of the file contents we just extracted can be found in the [[#Specifications|Belgian Electronic Identity Card content]] document&lt;br /&gt;
&amp;lt;br&amp;gt;Here are all the files you can extract:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
3F00_2F00      MF/DIR&lt;br /&gt;
3F00_DF00_5031 MF/Belpic/ODF                 (Object Directory File)&lt;br /&gt;
3F00_DF00_5032 MF/Belpic/TokenInfo&lt;br /&gt;
3F00_DF00_5034 MF/Belpic/AODF                (Authentication Object Directory File)&lt;br /&gt;
3F00_DF00_5035 MF/Belpic/PrKDF               (Private Key Directory File)&lt;br /&gt;
3F00_DF00_5037 MF/Belpic/CDF                 (Certificate Directory File)&lt;br /&gt;
3F00_DF00_5038 MF/Belpic/Cert#2              (auth)&lt;br /&gt;
3F00_DF00_5039 MF/Belpic/Cert#3              (non-rep)&lt;br /&gt;
3F00_DF00_503A MF/Belpic/Cert#4              (CA)&lt;br /&gt;
3F00_DF00_503B MF/Belpic/Cert#6              (Root)&lt;br /&gt;
3F00_DF00_503C MF/Belpic/Cert#8              (RRN)&lt;br /&gt;
3F00_DF01_4031 MF/ID/ID#RN                   (contains also hash of ID#Photo)&lt;br /&gt;
3F00_DF01_4032 MF/ID/SGN#RN                  (signature of ID#RN by RRN)&lt;br /&gt;
3F00_DF01_4033 MF/ID/ID#Address&lt;br /&gt;
3F00_DF01_4034 MF/ID/SGN#Address             (signature of ID#Address|SGN#RN by RRN)&lt;br /&gt;
3F00_DF01_4035 MF/ID/ID#Photo                (140x200 JPEG grayscale)&lt;br /&gt;
3F00_DF01_4038 MF/ID/PuK#7 ID                (CA role Hash SHA-1)&lt;br /&gt;
3F00_DF01_4039 MF/ID/Preferences&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that here we could extract the RRN Cert#8, which was not shown by the usual pkcs#15 tools...&lt;br /&gt;
&amp;lt;br&amp;gt;Note that the Preferences file is 100-byte zeroes, is customisable just with the cardholder PIN but the update_binary command is not supported, so [[#patch|I wrote a patch]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ xview 3F00_DF01_4035 &lt;br /&gt;
3F00_DF01_4035 is a 140x200 JPEG image, color space Grayscale, 1 comp, Huffman coding.&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
So to extract the picture via a simple script:&lt;br /&gt;
 echo -e &amp;quot;cd df01\nget 4035 mypic.jpg&amp;quot;|opensc-explorer&lt;br /&gt;
&lt;br /&gt;
===pkcs11-tool===&lt;br /&gt;
Differences with beid-pkcs11-tool are highlighted between *stars*&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pkcs11-tool --list-slots&lt;br /&gt;
Available slots:&lt;br /&gt;
Slot 0           iDream ID-SMID01 00 00&lt;br /&gt;
  token label:   BELPIC (Basic PIN)&lt;br /&gt;
 *token manuf:   (unknown)*&lt;br /&gt;
  token model:   PKCS #15 SCard&lt;br /&gt;
  token flags:   rng, *login required*, PIN initialized, token initialized&lt;br /&gt;
 *serial num  :  6CFF252C5F190218*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pkcs11-tool --list-objects&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pkcs11-tool --login --list-objects&lt;br /&gt;
Please enter User PIN: &lt;br /&gt;
Private Key Object; RSA &lt;br /&gt;
  label:      Authentication&lt;br /&gt;
  ID:         02&lt;br /&gt;
  Usage:      sign&lt;br /&gt;
Certificate Object, type = X.509 cert&lt;br /&gt;
  label:      Authentication&lt;br /&gt;
  ID:         02&lt;br /&gt;
Public Key Object; RSA 1024 bits&lt;br /&gt;
  label:      Authentication&lt;br /&gt;
  ID:         02&lt;br /&gt;
  Usage:      encrypt, verify&lt;br /&gt;
Private Key Object; RSA &lt;br /&gt;
  label:      Signature&lt;br /&gt;
  ID:         03&lt;br /&gt;
  Usage:      sign&lt;br /&gt;
Certificate Object, type = X.509 cert&lt;br /&gt;
  label:      Signature&lt;br /&gt;
  ID:         03&lt;br /&gt;
Public Key Object; RSA 1024 bits&lt;br /&gt;
  label:      Signature&lt;br /&gt;
  ID:         03&lt;br /&gt;
  Usage:      encrypt, verify&lt;br /&gt;
Certificate Object, type = X.509 cert&lt;br /&gt;
  label:      CA&lt;br /&gt;
  ID:         00&lt;br /&gt;
Public Key Object; RSA 2048 bits&lt;br /&gt;
  label:      CA&lt;br /&gt;
  ID:         04&lt;br /&gt;
  Usage:      encrypt, verify&lt;br /&gt;
Certificate Object, type = X.509 cert&lt;br /&gt;
  label:      Root&lt;br /&gt;
  ID:         00&lt;br /&gt;
Public Key Object; RSA 2048 bits&lt;br /&gt;
  label:      Root&lt;br /&gt;
  ID:         06&lt;br /&gt;
  Usage:      encrypt, verify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Strange, I need to login to extract the objects&lt;br /&gt;
&amp;lt;br&amp;gt;Strange, pubkeys can encrypt but privkey cannot decrypt...&lt;br /&gt;
&amp;lt;br&amp;gt;Strange, both RootCA and CitizenCA certificates have the same id 0&lt;br /&gt;
&amp;lt;br&amp;gt;And what&#039;s the format of those certificates when dumped out? Not DER neither PEM&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pkcs11-tool --login --read-object --id 0 --type cert|xxd&lt;br /&gt;
[...]&lt;br /&gt;
$ pkcs11-tool --login --read-object --id 2 --type pubkey |xxd&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pkcs11-tool --list-mechanisms&lt;br /&gt;
Supported mechanisms:&lt;br /&gt;
  SHA-1, digest&lt;br /&gt;
  *SHA256, digest*&lt;br /&gt;
  *SHA384, digest*&lt;br /&gt;
  *SHA512, digest*&lt;br /&gt;
  MD5, digest&lt;br /&gt;
  RIPEMD160, digest&lt;br /&gt;
  RSA-PKCS, sign, verify, unwrap, *decrypt*&lt;br /&gt;
  SHA1-RSA-PKCS, sign, verify&lt;br /&gt;
  MD5-RSA-PKCS, sign, verify&lt;br /&gt;
  RIPEMD160-RSA-PKCS, sign, verify&lt;br /&gt;
  *RSA-PKCS-KEY-PAIR-GEN, keypairgen*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Extra mechanisms available apparently...&lt;br /&gt;
&amp;lt;br&amp;gt;And they work:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
phil@mercure:~$ echo -n test|pkcs11-tool --hash --mechanism SHA512 |xxd &lt;br /&gt;
0000000: ee26 b0dd 4af7 e749 aa1a 8ee3 c10a e992  .&amp;amp;..J..I........&lt;br /&gt;
0000010: 3f61 8980 772e 473f 8819 a5d4 940e 0db2  ?a..w.G?........&lt;br /&gt;
0000020: 7ac1 85f8 a0e1 d5f8 4f88 bc88 7fd6 7b14  z.......O.....{.&lt;br /&gt;
0000030: 3732 c304 cc5f a9ad 8e6f 57f5 0028 a8ff  72..._...oW..(..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pkcs11-tool --login --test           &lt;br /&gt;
Please enter User PIN: &lt;br /&gt;
C_SeedRandom() and C_GenerateRandom():&lt;br /&gt;
  not implemented&lt;br /&gt;
Digests:&lt;br /&gt;
  all 4 digest functions seem to work&lt;br /&gt;
  MD5: OK&lt;br /&gt;
  SHA-1: OK&lt;br /&gt;
  RIPEMD160: OK&lt;br /&gt;
Signatures (currently only RSA signatures)&lt;br /&gt;
  testing key 0 (Authentication) &lt;br /&gt;
  all 4 signature functions seem to work&lt;br /&gt;
  testing signature mechanisms:&lt;br /&gt;
    RSA-PKCS: OK&lt;br /&gt;
    SHA1-RSA-PKCS: OK&lt;br /&gt;
    MD5-RSA-PKCS: OK&lt;br /&gt;
    RIPEMD160-RSA-PKCS: OK&lt;br /&gt;
  testing key 1 (1024 bits, label=Signature) with 1 signature mechanism&lt;br /&gt;
[opensc-pkcs11] sec.c:67:sc_set_security_env: returning with: Not supported&lt;br /&gt;
error: PKCS11 function C_Sign failed: rv = CKR_FUNCTION_NOT_SUPPORTED (0x54)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===pkcs15-tool===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pkcs15-tool --dump&lt;br /&gt;
PKCS#15 Card [BELPIC]:&lt;br /&gt;
        Version        : 1&lt;br /&gt;
        Serial number  : 1234567890ABCDEF1234567890ABCDEF&lt;br /&gt;
        Manufacturer ID: (unknown)&lt;br /&gt;
        Flags          : PRN generation, EID compliant&lt;br /&gt;
&lt;br /&gt;
PIN [Basic PIN]&lt;br /&gt;
        Com. Flags: 0x3&lt;br /&gt;
        ID        : 01&lt;br /&gt;
        Flags     : [0x30], initialized, needs-padding&lt;br /&gt;
        Length    : min_len:4, max_len:12, stored_len:8&lt;br /&gt;
        Pad char  : 0xFF&lt;br /&gt;
        Reference : 1&lt;br /&gt;
        Type      : bcd&lt;br /&gt;
        Path      : 3f00&lt;br /&gt;
&lt;br /&gt;
Private RSA Key [Authentication]&lt;br /&gt;
        Com. Flags  : 3&lt;br /&gt;
        Usage       : [0x4], sign&lt;br /&gt;
        Access Flags: [0x1D], sensitive, alwaysSensitive, neverExtract, local&lt;br /&gt;
        ModLength   : 1024&lt;br /&gt;
        Key ref     : 130&lt;br /&gt;
        Native      : yes&lt;br /&gt;
        Path        : 3f00df00&lt;br /&gt;
        Auth ID     : 01&lt;br /&gt;
        ID          : 02&lt;br /&gt;
&lt;br /&gt;
Private RSA Key [Signature]&lt;br /&gt;
        Com. Flags  : 3&lt;br /&gt;
        Usage       : [0x200], nonRepudiation&lt;br /&gt;
        Access Flags: [0x1D], sensitive, alwaysSensitive, neverExtract, local&lt;br /&gt;
        ModLength   : 1024&lt;br /&gt;
        Key ref     : 131&lt;br /&gt;
        Native      : yes&lt;br /&gt;
        Path        : 3f00df00&lt;br /&gt;
        Auth ID     : 01&lt;br /&gt;
        ID          : 03&lt;br /&gt;
&lt;br /&gt;
X.509 Certificate [Authentication]&lt;br /&gt;
        Flags    : 3&lt;br /&gt;
        Authority: no&lt;br /&gt;
        Path     : 3f00df005038&lt;br /&gt;
        ID       : 02&lt;br /&gt;
&lt;br /&gt;
X.509 Certificate [Signature]&lt;br /&gt;
        Flags    : 3&lt;br /&gt;
        Authority: no&lt;br /&gt;
        Path     : 3f00df005039&lt;br /&gt;
        ID       : 03&lt;br /&gt;
&lt;br /&gt;
X.509 Certificate [CA]&lt;br /&gt;
        Flags    : 3&lt;br /&gt;
        Authority: yes&lt;br /&gt;
        Path     : 3f00df00503a&lt;br /&gt;
        ID       : 04&lt;br /&gt;
&lt;br /&gt;
X.509 Certificate [Root]&lt;br /&gt;
        Flags    : 3&lt;br /&gt;
        Authority: yes&lt;br /&gt;
        Path     : 3f00df00503b&lt;br /&gt;
        ID       : 06&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&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;
&lt;br /&gt;
===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;
===eidenv===&lt;br /&gt;
Very interesting one...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ eidenv | recode UTF8..&lt;br /&gt;
BELPIC_CARDNUMBER: 123456789012&lt;br /&gt;
BELPIC_CHIPNUMBER: 1234567890ABCDEF1234567890ABCDEF&lt;br /&gt;
BELPIC_VALIDFROM: 20.06.2005&lt;br /&gt;
BELPIC_VALIDTILL: 20.06.2010&lt;br /&gt;
BELPIC_DELIVERINGMUNICIPALITY: Liege&lt;br /&gt;
BELPIC_NATIONALNUMBER: 00310100123&lt;br /&gt;
BELPIC_NAME: Teuwen&lt;br /&gt;
BELPIC_FIRSTNAMES: Philippe Yvon&lt;br /&gt;
BELPIC_INITIAL: F&lt;br /&gt;
BELPIC_NATIONALITY: Belge&lt;br /&gt;
BELPIC_BIRTHLOCATION: Liège&lt;br /&gt;
BELPIC_BIRTHDATE: 31 JAN  1900 (or 2000? ;-)&lt;br /&gt;
BELPIC_SEX: M&lt;br /&gt;
BELPIC_NOBLECONDITION: &lt;br /&gt;
BELPIC_DOCUMENTTYPE: 1&lt;br /&gt;
BELPIC_SPECIALSTATUS: 0&lt;br /&gt;
BELPIC_STREETANDNUMBER: Rue de l&#039;OpenSource 12 /b012&lt;br /&gt;
BELPIC_ZIPCODE: 1050&lt;br /&gt;
BELPIC_MUNICIPALITY: Ixelles&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ eidenv --exec /bin/bash&lt;br /&gt;
$ echo $BELPIC_NAME&lt;br /&gt;
Teuwen&lt;br /&gt;
$ exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But if the filter daemon beidpcscd is running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ eidenv &lt;br /&gt;
[eidenv] reader-pcsc.c:534:pcsc_connect: SCardConnect failed: Sharing violation.&lt;br /&gt;
[eidenv] card.c:228:sc_connect_card: returning with: Generic reader error&lt;br /&gt;
Failed to connect to card: Generic reader error&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I expected to get prompted by the filter but nothing like that&lt;br /&gt;
===patch===&lt;br /&gt;
The middleware is missing the function update_binary() while the card supports it and provides a writable file EF(Preferences) for the cardholder (you need first to login with your PIN)&lt;br /&gt;
&amp;lt;br&amp;gt;So I added it and [http://bugs.debian.org/470637 submitted it in bugreport #470637]&lt;br /&gt;
&amp;lt;br&amp;gt;Demo: how to install Linux on the eID (hum, so to speak...)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ opensc-explorer&lt;br /&gt;
OpenSC Explorer version 0.11.4&lt;br /&gt;
OpenSC [3F00]&amp;gt; cd df01&lt;br /&gt;
OpenSC [3F00/DF01]&amp;gt; verify CHV1 31:32:33:34&lt;br /&gt;
Code correct.&lt;br /&gt;
OpenSC [3F00/DF01]&amp;gt; put 4039 tux.txt&lt;br /&gt;
Total of 100 bytes written.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ opensc-explorer&lt;br /&gt;
OpenSC Explorer version 0.11.4&lt;br /&gt;
OpenSC [3F00]&amp;gt; cd df01&lt;br /&gt;
OpenSC [3F00/DF01]&amp;gt; cd 4039&lt;br /&gt;
OpenSC [3F00/DF01/4039]&amp;gt; cat&lt;br /&gt;
000000: 5B 47 65 6E 5D 0A 4C 47 3D 66 72 00 5F 20 20 20 [Gen].LG=fr._&lt;br /&gt;
000010: 00 00 00 00 00 00 00 00 20 20 20 2E 20 2E 20 20 ........   . .&lt;br /&gt;
000020: 00 00 00 00 00 00 00 00 20 20 20 2F 56 5C 20 20 ........   /V\&lt;br /&gt;
000030: 00 00 00 00 00 00 00 00 20 20 2F 2F 20 5C 5C 20 ........  // \\&lt;br /&gt;
000040: 00 00 00 00 00 00 00 00 20 2F 28 20 20 20 29 5C ........ /(   )\&lt;br /&gt;
000050: 00 00 00 00 00 00 00 00 20 20 5E 60 7E 27 5E 20 ........  ^`~&#039;^&lt;br /&gt;
000060: 00 00 00 00                                     ....&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux: to be sorted...==&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;
cf [[OpenSSH#Patch_for_login_with_eID]]&lt;br /&gt;
&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;
[https://openid.trustbearer.com TrustBearer OpenID] supports the Belgian eID as an authentication token. The service uses a browser add-on which contains a middleware stack that communicates directly with the reader &amp;amp; card. See a demonstration on [http://blog.rootshell.be/2008/04/28/openid-and-belgian-eid/ this blog].&lt;br /&gt;
&lt;br /&gt;
===Cryptonit===&lt;br /&gt;
From [http://www.opentrust.com/content/view/135/142index.en.html News:] OPENTRUST has announced the availability of a new version of Cryptonit. This latest release is fully compatible with the Belgium electronic ID card which when used with Cryptonit enables documents to be digitally signed.&amp;lt;br&amp;gt;[http://sourceforge.net/project/showfiles.php?group_id=110403 download]&lt;br /&gt;
&lt;br /&gt;
Under Debian:&lt;br /&gt;
 apt-get install cryptonit&lt;br /&gt;
 Device-&amp;gt;Load-&amp;gt; /usr/lib/libbeidpkcs11.so&lt;br /&gt;
It works, you can sign files with both certificates.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that the first PIN prompt doesn&#039;t matter, you&#039;ll get prompted directly by the libbeidpkcs11 middleware.&lt;br /&gt;
&amp;lt;br&amp;gt;Note that for repetitive Authentication signings (even after close/reopen cryptonit) it doesn&#039;t prompt me anymore for the next signatures, but well if I want to use the non-repudiation one.&lt;br /&gt;
&lt;br /&gt;
==Linux: TODO==&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;See also file:///usr/share/doc/opensc/PamModules.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;
See also file:///usr/share/doc/opensc/QuickStart.html&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;
&amp;lt;br&amp;gt;and https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/EidForums/ForumEidCardReverseProxy0004&lt;br /&gt;
&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;
&amp;lt;br&amp;gt;&#039;&#039;&#039;UPDATE&#039;&#039;&#039; openvpn 2.1~rc7-1 is available soon on Debian&lt;br /&gt;
&lt;br /&gt;
===TODO: Acrobat Reader===&lt;br /&gt;
acroread can deals with PKCS#11 modules...&lt;br /&gt;
 Document -&amp;gt; Security Settings -&amp;gt; Digital IDs -&amp;gt; PKCS#11 -&amp;gt; Attach module -&amp;gt; &lt;br /&gt;
I tried:&lt;br /&gt;
 /usr/lib/libbeidpkcs11.so         -&amp;gt; fails to load the module&lt;br /&gt;
 /usr/lib/onepin-opensc-pkcs11.so  -&amp;gt; ok&lt;br /&gt;
 /usr/lib/opensc-pkcs11.so         -&amp;gt; ok&lt;br /&gt;
But with those last 2 modules I don&#039;t know how to access the eID.&lt;br /&gt;
&lt;br /&gt;
See also https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/EidForums/ForumEidCards0068?t=2008-04-04T18:04:26Z and try with http://itext.ugent.be/articles/eid-pdf/&lt;br /&gt;
&lt;br /&gt;
===TODO: Misc===&lt;br /&gt;
* [http://opensignature.sourceforge.net/english.php OpenSignature] targeted for Italian eID&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;
* JAVA&lt;br /&gt;
** beidlib.jar: BEIDCard.html and Test.java&lt;br /&gt;
** http://homes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/JavaEidSampleCodeTOC&lt;br /&gt;
* Novell version in C#...&lt;br /&gt;
** I could compile but still runtime errors&lt;br /&gt;
* http://www.law.kuleuven.be/icri/publications/954eIDPDFSignatures.pdf.pdf and [http://www.law.kuleuven.be/icri/all_pubs.php?action=pubs_topic&amp;amp;id=2&amp;amp;where= other papers]&lt;br /&gt;
* http://www.tonywhitmore.co.uk/cgi-local/wiki.pl?UsefulNotes/SmartCards&lt;br /&gt;
* WPA?? file:///usr/share/doc/opensc/WPA.html&lt;br /&gt;
* https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Eid/EidForum Danny opened some forums on eID, a lot to read probably ;-)&lt;br /&gt;
** [https://securehomes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/EidForums/ForumEidCards0031  What about the preferences file?]&lt;br /&gt;
* http://javadoc.iaik.tugraz.at/iaik_jce/current/index.html&lt;br /&gt;
* http://www.uvcw.be/e-communes/eid &amp;amp; http://www.uvcw.be/articles/3,90,39,39,1398.htm&lt;br /&gt;
* http://www.disinstitute.be/&lt;br /&gt;
* http://www.eidating.be/&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;http://www.belgium.be/eportal/application?pageid=contentPage&amp;amp;docId=30000 .. 45000?&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* http://homes.esat.kuleuven.be/~decockd/wiki/bin/view.cgi/Main/AppletEidCardsUtilityTOC&lt;br /&gt;
** the applet loads but nothing happens when trying to see the content of the card :-(&lt;br /&gt;
* http://www.linux.com/feature/131527&lt;/div&gt;</summary>
		<author><name>Dorian</name></author>
	</entry>
</feed>