Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Cartão de Cidadão: Novo middleware OpenSource <ul>Luis Medinas  < [email_address] > </ul>Parceria:
Estado actual <ul><li>Middleware  closed source
Violação da GNU GPL
Conceito obsoleto (tecnologias antigas)
Dificuldade em suportar multiplicas plataformas
Pouca documentação técnica </li></ul>
Novo middleware <ul><li>Princípios do FOSS
Fornecer um projecto modular
Baseado no Belgian eID middleware
Upcoming SlideShare
Loading in …5
×

Apresentacao seminariotecnicocc

653 views

Published on

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

Apresentacao seminariotecnicocc

  1. 1. Cartão de Cidadão: Novo middleware OpenSource <ul>Luis Medinas < [email_address] > </ul>Parceria:
  2. 2. Estado actual <ul><li>Middleware closed source
  3. 3. Violação da GNU GPL
  4. 4. Conceito obsoleto (tecnologias antigas)
  5. 5. Dificuldade em suportar multiplicas plataformas
  6. 6. Pouca documentação técnica </li></ul>
  7. 7. Novo middleware <ul><li>Princípios do FOSS
  8. 8. Fornecer um projecto modular
  9. 9. Baseado no Belgian eID middleware
  10. 10. Multiplataforma/arquitecturas (Windows, MacOSX, Linux) 32/64
  11. 11. Manter uma base coerente para o futuro
  12. 12. Suporte aplicacional (Ms Office, Firefox, LibreOffice, Outlook, IE e etc...) </li></ul>
  13. 13. “ Big Picture” PCSC-lite Kernel PKCS11 CardLayer eidlib AppLayer eidgui Crypto API CSP SDK Java .Net MS Windows PKCS11 apps
  14. 14. <ul><li>Manter o middleware multiplataforma/multiarquitectura
  15. 15. Sistema modular
  16. 16. Compreensão das applets (IAS/GEMSAFE)
  17. 17. Compatibilidade com o Middleware anterior
  18. 18. Sincronização com serviços Web
  19. 19. Novas funcionalidades
  20. 20. Contribuir código </li></ul>Desafios
  21. 21. Hello World C++ //***************************************************************************** // PTeID SDK sample code. // This sample demonstrates how to use the eID SDK to read a Portuguese eID card. // The program will dump the data to the standard output for each card reader // it finds. //***************************************************************************** #include <iostream> #include &quot;eidlib.h&quot; using namespace eIDMW; //***************************************************************************** // Get the data and dump to the screen // Beware: The data coming from the cards is encoded in UTF8! //***************************************************************************** void getEIDData( PTEID_EIDCard& card ) { PTEID_EId& eid = card.getID(); if ( card.isTestCard() ) { std::cout << &quot;Error: This is a test card. Can not read data...&quot; << std::endl; return; } std::cout << &quot;tDocumentType : &quot; << eid.getDocumentType() << std::endl; std::cout << &quot;tPersonal data:&quot; << std::endl; std::cout << &quot;tFirstName : &quot; << eid.getFirstName() << std::endl; std::cout << &quot;tSurname : &quot; << eid.getSurname() << std::endl; std::cout << &quot;tGender : &quot; << eid.getGender() << std::endl; std::cout << &quot;tDateOfBirth : &quot; << eid.getDateOfBirth() << std::endl; std::cout << &quot;tLocationOfBirth : &quot; << eid.getLocationOfBirth() << std::endl; std::cout << &quot;tNationality : &quot; << eid.getNationality() << std::endl; std::cout << &quot;tNationalNumber : &quot; << eid.getNationalNumber() << std::endl; std::cout << &quot;tMemberOfFamily : &quot; << eid.getMemberOfFamily() << std::endl; std::cout << &quot;tValidityBeginDate : &quot; << eid.getValidityBeginDate() << std::endl; std::cout << &quot;tValidityEndDate : &quot; << eid.getValidityEndDate() << std::endl; PTEID_EIdAddress& eidaddress = card.getAddr(); std::cout << &quot;tStreet : &quot; << eidaddress.getStreet() << std::endl; std::cout << &quot;tZipCode : &quot; << eidaddress.getZipCode() << std::endl; std::cout << &quot;tMunicipality : &quot; << eidaddress.getMunicipality() << std::endl; std::cout << &quot;tIssuingMunicipality: &quot; << eidaddress.getIssuingMunicipality() << std::endl; } //***************************************************************************** // Get the data from a Portuguese EID card //***************************************************************************** void getEidCardData( PTID_ReaderContext& readerContext ) { PTEID_EIDCard& card = readerContext.getEIDCard(); getEIDData(card); } //***************************************************************************** // Show the info of the card in the reader //***************************************************************************** void showCardInfo( const char* readerName ) { PTEID_ReaderContext& readerContext = ReaderSet.getReaderByName( readerName ); if ( readerContext.isCardPresent() ) { //PTEID_CARDTYPE_EID: getEidCardData( readerContext ); } } //***************************************************************************** // Show the reader info an get the data of the card if present //***************************************************************************** void showReaderCardInfo( const char* readerName ) { PTEID_ReaderContext& readerContext = ReaderSet.getReaderByName( readerName ); std::cout << &quot;Reader: &quot; << readerName << std::endl; std::cout << &quot;tCard present: &quot; << (readerContext.isCardPresent()? &quot;yes&quot; :&quot;no&quot;) << std::endl; showCardInfo( readerName ); std::cout << std::endl; } //***************************************************************************** // scan all the card readers and if a card is present, show the content of the // card. //***************************************************************************** void scanReaders( void ) { unsigned long nrReaders = ReaderSet.readerCount(); const char* const* readerList = ReaderSet.readerList(); std::cout << &quot;Nr of card readers detected: &quot; << nrReaders << std::endl; for ( size_t readerIdx=0; readerIdx<nrReaders; readerIdx++) { showReaderCardInfo( readerList[readerIdx] ); } } //***************************************************************************** // Main entry point //***************************************************************************** int main( int argc, char* argv[] ) { std::cout << &quot;PTeID SDK C++ sample program: read_eid&quot; << std::endl; scanReaders(); PTEID_ReleaseSDK(); }
  22. 22. Hello World Java //***************************************************************************** // eID SDK sample code. // This sample demonstrates how to use the eID SDK to read a Portuguese eID card. // The program will dump the data to the standard output for each card reader // it finds. // // compile: // javac -classpath <path_to>pteid[35]libJava.jar main.java // // run (windows): // set PATH=<path_to_dll's>;%PATH% // java -cp <path_to>pteid35libJava.jar;. main //***************************************************************************** import java.lang.*; import pt.portuguese.eid.*; public class main { //***************************************************************************** // Get the data and dump to the screen // Beware: The data coming from the cards is encoded in UTF8! //***************************************************************************** private static void getEIDData(PTEID_EIDCard card) throws Exception { PTEID_EId eid = card.getID(); System.out.println( &quot;tDocumentType : &quot; + eid.getDocumentType() ); System.out.println( &quot;tPeronal data:&quot; ); System.out.println( &quot;t-------------&quot; ); System.out.println( &quot;tFirstName1 : &quot; + eid.getFirstName1() ); System.out.println( &quot;tSurname : &quot; + eid.getSurname() ); System.out.println( &quot;tGender : &quot; + eid.getGender() ); System.out.println( &quot;tDateOfBirth : &quot; + eid.getDateOfBirth() ); System.out.println( &quot;tLocationOfBirth : &quot; + eid.getLocationOfBirth() ); System.out.println( &quot;tNationality : &quot; + eid.getNationality() ); System.out.println( &quot;tNationalNumber : &quot; + eid.getNationalNumber() ); System.out.println( &quot;tSpecialOrganization: &quot; + eid.getSpecialOrganization() ); System.out.println( &quot;tMemberOfFamily : &quot; + eid.getMemberOfFamily() ); System.out.println( &quot;tValidityBeginDate : &quot; + eid.getValidityBeginDate() ); System.out.println( &quot;tValidityEndDate : &quot; + eid.getValidityEndDate() ); PTEIDAddress_EId eidaddress = card.getAddr(); System.out.println( &quot;tStreet : &quot; + eid.getStreet() ); System.out.println( &quot;tZipCode : &quot; + eid.getZipCode() ); System.out.println( &quot;tMunicipality : &quot; + eid.getMunicipality() ); System.out.println( &quot;tCountry : &quot; + eid.getCountry() ); System.out.println( &quot;tIssuingMunicipality: &quot; + eid.getIssuingMunicipality() ); } //***************************************************************************** // Get the data from a Portuguese EID card //***************************************************************************** private static void getEidCardData(PTEID_ReaderContext readerContext) throws Exception { PTEID_EIDCard card = readerContext.getEIDCard(); getEIDData(card); } //***************************************************************************** // Show the info of the card in the reader //***************************************************************************** private static void showCardInfo(String readerName) throws Exception { PTEID_ReaderContext readerContext = PTEID_ReaderSet.instance().getReaderByName( readerName ); if ( readerContext.isCardPresent() ) { System.out.println(&quot;tType : &quot; + getCardTypeStr(readerContext)); PTEID_CardType cardType = readerContext.getCardType(); getEidCardData(readerContext); } } //***************************************************************************** // Show the reader info an get the data of the card if present //***************************************************************************** private static void showReaderCardInfo(String readerName) throws Exception { PTEID_ReaderContext readerContext = PTEID_ReaderSet.instance().getReaderByName( readerName ); System.out.println(&quot;Reader: &quot;+readerName); System.out.println(&quot;tCard present: &quot; + (readerContext.isCardPresent()? &quot;yes&quot; :&quot;no&quot;)); showCardInfo( readerName ); System.out.println(&quot;&quot;); } //***************************************************************************** // scan all the card readers and if a card is present, show the content of the // card. //***************************************************************************** private static void scanReaders() throws Exception { long nrReaders = PTEID_ReaderSet.instance().readerCount(); System.out.println(&quot;Nr of card readers detected: &quot;+nrReaders); for ( int readerIdx=0; readerIdx<nrReaders; readerIdx++) { String readerName = PTEID_ReaderSet.instance().getReaderName(readerIdx); showReaderCardInfo(readerName); } }
  23. 23. Hello World Java (cont.) //***************************************************************************** // Main entry point //***************************************************************************** public static void main(String argv[]) { System.out.println(&quot;[Info] PTeID SDK Java sample program: read_eid&quot;); String osName = System.getProperty(&quot;os.name&quot;); if ( -1 != osName.indexOf(&quot;Windows&quot;) ) { System.out.println(&quot;[Info] Windows system!!&quot;); System.loadLibrary(&quot;beid35libJava_Wrapper&quot;); } else { System.loadLibrary(&quot;beidlibJava_Wrapper&quot;); } try { BEID_ReaderSet.initSDK(); scanReaders(); } catch( BEID_Exception e) { System.out.println(&quot;[Catch] BEID_Exception:&quot; + e.GetError()); } catch( Exception e) { System.out.println(&quot;[Catch] Exception:&quot; + e.getMessage()); } try { BEID_ReaderSet.releaseSDK(); } catch (BEID_Exception e) { System.out.println(&quot;[Catch] BEID_Exception:&quot; + e.GetError()); } catch (Exception e) { System.out.println(&quot;[Catch] Exception:&quot; + e.getMessage()); } } }
  24. 24. Obrigado <ul><li>Luis Medinas < [email_address] >
  25. 25. Http://www.twitter.com/lmedinas
  26. 26. Http://www.identi.ca/lmedinas
  27. 27. Http://www.livejournal.com/lmedinas </li></ul>Questões ?

×