Caixa Mágica Software developed the Citizen Card Middleware, an open-source and robust solution aimed at enhancing the digital capabilities of the Portuguese ID Card. This middleware strengthens security in online transactions while improving overall efficiency.
Desafio
In 2011, Caixa Mágica Software faced the challenge of creating an open-source, robust and advanced middleware for the Portuguese ID Card. Driven by the need to enhance the digital functionalities of the card and strengthen security in online transactions. The objective was to establish a versatile solution that provided secure authentication, qualified digital signatures and efficient integration with digital services. Simplifying the interaction between citizens and government organizations.
This project continues to be developed by CMS in collaboration with the National Printing House (INCM), Agency for Administrative Modernization (AMA) and the Institute of Registries and Notaries (IRN).

Solution:
Caixa Mágica chose to use the Qt Framework and the C/C++ programming language, combined with open-source technologies such as OpenSSL and Poppler. This choice allowed the creation of a highly modular and adaptable middleware, meeting the technical and functional requirements established by the Agency for Administrative Modernization (AMA), the Institute of Registries and Notaries (IRN) and the National Printing House (INCM). The development follows agile methodologies, with regular updates. The solution is comprehensively documented in repositories on GitHub, ensuring transparency and accessibility to all interested parties. Furthermore, the choice of the EUPL – European Union Public Licence 1.2 reinforced the commitment to open source.
A nível das funcionalidades podemos destacar:
Gestão de Certificados Digitais:
O Middleware administra os certificados digitais presentes no Cartão de Cidadão, garantindo que estejam atualizados e prontos para uso em autenticação e assinaturas digitais.
Acesso a Dados Pessoais:
Authorized applications can access personal data stored on the Portuguese Citizen Card, such as name, identification number, photograph and official address, in accordance with the cardholder’s permissions.
Assinatura Digital:
Facilitates the use of the Portuguese Citizen Card for electronically signing documents, contracts and online transactions, ensuring authenticity and integrity in signatures. This middleware can be defined as the “layer” of software between the computer and the Portuguese Citizen Card. Providing authentication and electronic signature functionalities to the operating system and other applications.
Autenticação:
Possibilita que os cidadãos utilizem o Cartão de Cidadão para autenticação segura em serviços online, garantindo a confirmação da identidade do titular ao aceder a serviços digitais.
Segurança:
Desempenha um papel crucial na segurança, assegurando que as operações realizadas com o Cartão de Cidadão sejam seguras e que as informações pessoais do titular estejam protegidas.
Integração:
Allows the integration of the Portuguese Citizen Card with various government and commercial applications, making it a versatile tool for accessing digital services such as tax declaration, healthcare and online banking.
Chave Móvel Digital:
The Portuguese Citizen Card Middleware allows signatures with the Mobile Digital Key (CMD) within the middleware’s graphical application as well as in other system applications. The middleware integrates services available through the Agency for Administrative Modernization (AMA). Certified by the Portuguese state, the CMD serves as both an authentication and digital signature tool. With just a single login, it enables access to numerous public and private portals and the ability to sign digital documents. By linking a mobile phone number to an individual’s identification document whether it’s a Portuguese Citizen Card, Identity Card, or, in the case of foreign residents, a passport, residence title, or card. The CMD ensures secure and streamlined digital identification.
Atributos Profissionais:
O Sistema de Certificação de Atributos Profissionais (SCAP) permite ao cidadão, através do Cartão de Cidadão ou da Chave Móvel Digital, assinar um documento na qualidade das funções que desempenha enquanto profissional em instituições públicas ou empresas privadas. Para mais informações, carregue aqui.
Impact:
A solução da Caixa Mágica teve e continua a ter um impacto significativo em Portugal. Todos os cidadãos e empresas que interagem com o governo usam direta ou indiretamente o Middleware do Cartão de Cidadão. O código aberto e a comunidade ativa em torno do projeto garantem a sustentabilidade a longo prazo. O financiamento do governo, aliado à participação contínua da comunidade e ao apoio da Caixa Mágica, solidificam a posição da solução como um pilar essencial da transformação digital em Portugal.
Destacamos de seguida alguns resultados significativos e decorrentes do desenvolvimento e implementação do Middleware do Cartão de Cidadão:
Uso Generalizado:
Todos os cidadãos e empresas interagem direta ou indiretamente com o Middleware, agilizando processos e proporcionando segurança em transações digitais.
Assinaturas Oficiais:
Tornou-se a solução exclusiva para assinaturas de documentos governamentais e licitações, estabelecendo um padrão de autenticação confiável.
Adoção Privada:
O uso privado está em ascensão, com cidadãos a recorrerem a assinaturas digitais como alternativa segura às assinaturas manuscritas em transações pessoais.
Integração com Entidades Reguladoras:
Successful integration with the Commercial Registry Authority allows citizens to sign as company administrators and qualified professionals can sign documents related to their professions.
Caixa Mágica Software, in collaboration with government entities, has built an innovative solution that has overcome significant challenges. The Portuguese Citizen Card Middleware not only met technological and functional needs but also set a standard for public-private collaboration and effective use of open source, promoting transparency. This case study highlights not only the effectiveness and innovation of the solution but also its positive, continuous and direct impact on society.
Pode aceder à página do Git do Middleware do Cartão de Cidadão aqui.