
begin ================= Disclaimer ================= begin
I you read email using pine, may want to use the Belgian eID-enabled pine client. Follow the installation procedure at Godot's pine configuration for Belgian eID cards section, and become happy. It currently validates signatures on incoming s/mime emails (e.g., if digitally signed with an eID card). Sending eID card-signed mails is under development. 
A man of genius makes no mistakes. His errors are volitional and are the portals of discovery -- James Joyce, "Ulysses"
end ================= Disclaimer ================= end

Open source software to illustrate the eID card's basic functionality -- no guarantees -- undocumented -- use at your own risk ];->>
System requirements:
# Quick pointer to what you need if you are using a Unix variant:
| # location of the eID-specific code and jpcsc library: export BELPIC=~/eid mkdir -p $BELPIC/tarfiles $BELPIC/sources $BELPIC/pcsc # specifying the java virtual machine which is used on this machine: if test :$JAVA_HOME: = ::;then export JAVA_HOME=/usr/lib/j2sdk1.4.2_05 fi if test -e $JAVA_HOME/bin/javac then echo -n else echo SERIOUS PROBLEM: Could not find a java compiler... fi export PATH=$JAVA_HOME/bin:$PATH # specification of the source code and jpcsc files: export CLASSPATH=$BELPIC/sources:$BELPIC/jpcsc/bin/jpcsc.jar # location of precompiled native jpcsc libary: export LD_LIBRARY_PATH=$BELPIC/jpcsc/build/linux:$BELPIC/pcsc/lib # determine where you will store the data read out from the eID card: export BELPICDATA=$BELPIC/data mkdir -p $BELPICDATA |
| cd $BELPIC/pcsc wget https://alioth.debian.org/download.php/419/pcsc-lite-1.2.0.tar.gz tar -xzvf pcsc-lite-1.2.0.tar.gz cd pcsc-lite-1.2.0 ./configure --prefix=$BELPIC/pcsc --enable-usbdropdir=$BELPIC/pcsc/drivers --enable-muscledropdir=$BELPIC/pcsc/services make install cd $BELPIC/pcsc/lib ln -s libpcsclite.so.0 libpcsclite.so.1 |
| cd $BELPIC/tarfiles if wget http://godot.studentenweb.org/site/EidCards/eidApplications/javaCode/jpcsc-0.8.0.zip then echo successfully fetched the bridge software between the java source code and the smartcard reader echo echo problem fetching the bridge software between the java source code and the smartcard reader =====================================;ficd $BELPIC if unzip $BELPIC/tarfiles/jpcsc-0.8.0.zip then echo everything has successfully been untarred else echo problem untarring the bridge software =====================================;ficd $BELPIC/jpcsc sed s/'usr\/local\/pcsc'/'${BELPIC}\/pcsc'/ Config > Config.tmp mv Config.tmp Config make |
| cd $BELPIC/tarfiles if wget http://godot.studentenweb.org/site/EidCards/eidApplications/javaCode/generation.one.v0007.tgz then echo successfully fetched the source code else echo problem fetching the source code =====================================;ficd $BELPIC/sources # All files are self-explanatory if tar -xzvf $BELPIC/tarfiles/generation.one.v0007.tgz then echo everything has successfully been untarred else echo problem untarring the source code =====================================;fi |
| if javac `find be -name \*java` then echo all the code has successfully been compiled else echo problem compiling the source code =====================================;fi |
| if java be.godot.sc.apps.eid.be.ScReadNonRepudiationCertificate $BELPICDATA/citizen.identification.certificate.der then if java be.godot.sc.apps.eid.be.ScReadAuthenticationCertificate $BELPICDATA/citizen.authentication.certificate.der then echo successfully read out the authentication and non-repudiation certificates of the citizen else echo problem reading out the authentication certificate =====================================;fielse echo problem reading out the non-repudiation certificate =====================================;fi |
| if java be.godot.sc.apps.eid.be.ScReadCitizenAddressData $BELPICDATA/citizen.address.bin > $BELPICDATA/citizen.address.txt then cat $BELPICDATA/citizen.address.txt else echo problem reading out citizen address data =====================================;fi |
| if java be.godot.sc.apps.eid.be.ScReadCitizenIdentityData $BELPICDATA/citizen.identity.file.bin > $BELPICDATA/citizen.identity.file.txt then cat $BELPICDATA/citizen.identity.file.txt else echo problem reading out the citizen data =====================================;fi |
| if java be.godot.sc.apps.eid.be.ScReadCitizenPhoto $BELPICDATA/citizen.photo.jpg then echo successfully read the citizen photo else echo problem reading the citizen photo =====================================;fi |
| if java be.godot.sc.apps.eid.be.ScReadRootCACertificate $BELPICDATA/citizen.rootca.der then echo successfully read the root ca certificate else echo problem reading the root ca certificate =====================================;fi |
| if java be.godot.sc.apps.eid.be.ScReadCACertificate $BELPICDATA/citizen.ca.der then echo successfully read the citizen ca certificate else echo problem reading the citizen ca certificate =====================================;fi |
| if java be.godot.sc.apps.eid.be.ScReadRRNCertificate $BELPICDATA/rrn.certificate.der then echo successfully read the RRN certificate else echo problem reading the RRN certificate =====================================;fi |
| if openssl x509 -in $BELPICDATA/citizen.rootca.der -inform DER -outform PEM -out $BELPICDATA/citizen.rootca.pem then if openssl x509 -in $BELPICDATA/rrn.certificate.der -inform DER -outform PEM -out $BELPICDATA/rrn.certificate.pem then if openssl x509 -in $BELPICDATA/citizen.ca.der -inform DER -outform PEM -out $BELPICDATA/citizen.ca.pem then if openssl x509 -in $BELPICDATA/citizen.identification.certificate.der -inform DER -outform PEM -out $BELPICDATA/citizen.identification.certificate.pem then if openssl x509 -in $BELPICDATA/citizen.authentication.certificate.der -inform DER -outform PEM -out $BELPICDATA/citizen.authentication.certificate.pem; then echo successfully converted all certificates from DER to PEM format else echo problem converting the authentication certificate =====================================;fielse echo problem converting the non-repudiation certificate =====================================;fielse echo problem converting the citizen ca certificate =====================================;fielse echo problem converting the root ca certificate =====================================;fielse echo problem converting the RRN certificate =====================================;fi |
| cd $BELPICDATA for a in *pem;do if openssl x509 -in $a -text > `basename $a .pem`.txt then echo successfully converted $a else echo problem converting $a =====================================;fidone |
| if openssl verify -CAfile $BELPICDATA/citizen.rootca.pem $BELPICDATA/citizen.rootca.pem then if openssl verify -CAfile $BELPICDATA/citizen.rootca.pem $BELPICDATA/citizen.ca.pem then cat $BELPICDATA/citizen.rootca.pem $BELPICDATA/citizen.ca.pem > $BELPICDATA/trusted.certificates.txt if openssl verify -CAfile $BELPICDATA/trusted.certificates.txt $BELPICDATA/citizen.identification.certificate.pem then if openssl verify -CAfile $BELPICDATA/trusted.certificates.txt $BELPICDATA/citizen.authentication.certificate.pem then echo successfully verified the non-repudiation and authentication certificates of the citizen and the certificates of the root ca and the citizen ca else echo problem detected with the authentication certificate of the citizen =====================================;fielse echo problem detected with the non-repudiation certificate of the citizen =====================================;fielse echo problem detected with the citizen ca certificate =====================================;fielse echo problem detected with the root ca certificate =====================================;fi |
| if openssl x509 -in $BELPICDATA/citizen.rootca.der -inform DER -text -noout then if openssl x509 -in $BELPICDATA/citizen.ca.der -inform DER -text -noout then if openssl x509 -in $BELPICDATA/citizen.identification.certificate.der -inform DER -text -noout then if openssl x509 -in $BELPICDATA/citizen.authentication.certificate.der -inform DER -text -noout then echo successful dump of the authentication and non-repudiation certificates of the citizen and of the root ca and the citizen ca else echo problem dumping the authentication certificate =====================================;fielse echo problem dumping the non-repudiation certificate =====================================;fielse echo problem dumping the citizen ca certificate =====================================;fielse echo problem dumping the root ca certificate =====================================;fi |

| if java be.godot.sc.apps.eid.be.ScGenerateAndVerifyNonRepudiationSignature then echo non-repudiation signature successfully generated else echo problem generating the non-repudiation signature =====================================;fi |
| if java be.godot.sc.apps.eid.be.ScGenerateAndVerifyAuthenticationSignature then echo authentication signature successfully generated else echo problem generating the authentication signature =====================================;fi |

| wget http://certs.eid.belgium.be/belgiumrca.crt openssl x509 -in belgiumrca.crt -inform der -outform pem -out cafile echo starting signature verification... if openssl smime -in smime.txt -CAfile cafile -verify -out email.content.txt -signer signer.certificate then echo the email signer used the following certificate: openssl x509 -in signer.certificate -text -noout echo echo the email contains: === begin =======cat email.content.txt echo echo email content: === end =======echo signature was cryptographically correct else echo signature was ======== INVALID ============fi |
Welcome at Godot.Be |