Usando token de e-CPF no GNU Linux para assinaturas digitais e serviços diversos

Tokens StarSign e Safenet (Fonte: certificadora AC Digital)
$ lsusb
Aladdin Knowledge Systems Token JC
Giesecke & Devrient GmbH
$ sudo apt install opensc

Token StarSign

$ opensc-tool -n
Using reader with a card: Giesecke & Devrient GmbH StarSign CUT S [.] (03200312006166) 00 00
Unsupported card
Gerenciador Tokenadmin da StarSign

Token Safenet

$ opensc-tool -n
Using reader with a card: AKS ifdh [eToken 5110 SC] 00 00
Unsupported card
SafeNet Authentication Client Tools

Integração do token com o Firefox

$ locate libeToken.so
/lib/libeToken.so.10
/lib/libeToken.so.10.0
/lib/libeToken.so.10.0.37
/usr/lib/libeToken.so
/usr/lib/libeToken.so.10
ls -lh /usr/lib/libaetpkss*
Firefox Security Devices adicionando token

Portal gov.br (testando o token)

Lista de confiabilidades do gov.br inclui a conta comprovada via certificado digital

Utilizando o token com ReceitaNet e ColetaNacional

sudo mkdir /opt/jre
cd /opt/jre
# Faça download do JRE 8 (não do SDK!) para Linux64 (.tar.gz) em: https://java.com/en/download/
sudo tar -zxvf jre-8u281-linux-x64.tar.gz
sudo update-alternatives --install /usr/bin/java java /opt/jre/jre1.8.0_281/bin/java 100
sudo update-alternatives --install /usr/bin/javaws javaws /opt/jre/jre1.8.0_281/bin/javaws 100
sudo update-alternatives --config java
# Escolha opção /opt/jre/jre1.8.0_281/bin/java
sudo update-alternatives --config javaws
# Escolha opção /opt/jre/jre1.8.0_281/bin/javaws

====== testando versão java ======
java -version
# java version "1.8.0_281"
javaws
# Java(TM) Web Start 11.281.2.09-fcs
====== invocando .jnlp ===========
javaws ~/Downloads/ColetaNac-desktop.jnlp

Assinatura de Documentos do Conselho Federal de Medicina (CFM)

Menu do assinador digital do SERPRO
Assinando PDF usando o Assinador Serpro e token e-CPF
PDF contains an encryption dictionary, please remove it with setAllSecurityToBeRemoved() or set a protection policy with protect()
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=%stdout% -c .setpdfwrite -f arquivo-travado.pdf > arquivo-destravado.pdf

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store