# Token A3 Físico

<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Este guia é um passo a passo sobre como instalar o componente do Presto para que seja possível acessar sistemas via Presto com o token A3 físico.</span>

**<span style="color: #1b4fd6;"><span style="mso-spacerun: yes;"> </span>Suporte:<span style="mso-spacerun: yes;"> </span></span>**<span style="color: #1a1a2e;">em caso de dúvidas, entre em contato com a nossa equipe de suporte pelo e-mail </span>**<span style="color: #1b4fd6;">leandro@oystr.com.br</span>**<span style="color: #1a1a2e;">.</span>

# **<span style="font-size: 13.0pt; color: #1b4fd6;">Pré-requisitos de funcionamento</span>**

<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Para que o Presto possa usar o A3 para acessar um sistema, é necessário que:</span>

**<span style="font-size: 11.0pt; line-height: 125%; color: #1b4fd6;">1.<span style="mso-spacerun: yes;"> </span></span>**<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">O token A3 esteja instalado em uma máquina ligada e com acesso à internet no momento em que o usuário do Presto deseja realizar o login.</span>

**<span style="font-size: 11.0pt; line-height: 125%; color: #1b4fd6;">2.<span style="mso-spacerun: yes;"> </span></span>**<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">A máquina deve estar rodando o componente </span><span style="font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #0f172a; background: #F3F4F6;">a3-proxy-go</span><span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">, que faz a conexão entre o Presto e o A3.</span>

**<span style="font-size: 11.0pt; line-height: 125%; color: #1b4fd6;">3.<span style="mso-spacerun: yes;"> </span></span>**<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">O certificado A3 deve estar corretamente configurado no cofre do Presto.</span>

**<span style="font-size: 11.0pt; line-height: 125%; color: #1b4fd6;">4.<span style="mso-spacerun: yes;"> </span></span>**<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">O usuário tenha a permissão de acessar o site desejado com o A3.</span>

# **<span style="font-size: 13.0pt; color: #1b4fd6;">Requisitos</span>**

<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Para instalação do a3-proxy-go, é necessária uma máquina Linux com Ubuntu 22.04 LTS ou Ubuntu 24.04 LTS, com os seguintes pacotes instalados:</span>

<span style="mso-list: Ignore;">●<span style="font: 7.0pt 'Times New Roman';"> </span></span><span style="font-size: 11.0pt; line-height: 120%; color: #1a1a2e;">pcscd (instalado e rodando)</span>

<span style="mso-list: Ignore;">●<span style="font: 7.0pt 'Times New Roman';"> </span></span><span style="font-size: 11.0pt; line-height: 120%; color: #1a1a2e;">docker (instalado e rodando)</span>

<span style="mso-list: Ignore;">●<span style="font: 7.0pt 'Times New Roman';"> </span></span><span style="font-size: 11.0pt; line-height: 120%; color: #1a1a2e;">driver do seu token físico</span>

<span style="mso-list: Ignore;">●<span style="font: 7.0pt 'Times New Roman';"> </span></span><span style="font-size: 11.0pt; line-height: 120%; color: #1a1a2e;">a3-proxy-go (instalado e rodando)</span>

<span style="mso-list: Ignore;">●<span style="font: 7.0pt 'Times New Roman';"> </span></span><span style="font-size: 11.0pt; line-height: 120%; color: #1a1a2e;">token A3 (plugado na máquina e devidamente reconhecido)</span>

# **<span style="font-size: 13.0pt; color: #1b4fd6;">Preparação</span>**

## **<span style="font-size: 11.0pt; color: #1a1a2e;">Interface USB</span>**

<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Certifique-se de que o token A3 está conectado à máquina e execute o seguinte comando:</span>

<span style="font-size: 9.0pt; font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #0f172a;">sudo lsusb | grep -iE 'giesecke|starsign|token|smart'</span>

<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">O resultado deve ser algo semelhante a:</span>

<span style="font-size: 9.0pt; font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #0f172a;">Bus 001 Device 004: ID 0529:0620 Giesecke &amp; Devrient GmbH StarSign CUT</span>

<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Indicando que o token A3 está conectado à máquina e que o sistema USB reconheceu o token.</span>

## **<span style="font-size: 11.0pt; color: #1a1a2e;">pcscd</span>**

<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Certifique-se de que o daemon pcscd esteja rodando e execute os seguintes comandos:</span>

<span style="font-size: 9.0pt; font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #0f172a;">sudo pcscd --version  
sudo systemctl is-active pcscd  
sudo ls -la /run/pcscd/pcscd.comm  
sudo pcsc\_scan -n</span>

<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">O resultado do último comando deve ser algo semelhante a:</span>

<span style="font-size: 9.0pt; font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #0f172a;">Scanning present readers...  
0: Giesecke &amp; Devrient StarSign CUT (00000000) 00 00  
<span style="mso-spacerun: yes;"> </span>Reader 0: Giesecke &amp; Devrient StarSign CUT (00000000) 00 00  
<span style="mso-spacerun: yes;"> </span>Card state: Card inserted,  
<span style="mso-spacerun: yes;"> </span>ATR: 3B FF 96 00 00 81 31 FE 43 80 31 80 65 B0 84 41 3D F6 12 0F FE 82 90 00 55</span>

<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Indicando que o pcscd reconhece o seu token A3. Em caso de erro, verifique se o token A3 está devidamente conectado à máquina, com o driver instalado e com o daemon pcscd rodando.</span>

<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Caso seja necessário, instale os pacotes do pcscd com:</span>

<span style="font-size: 9.0pt; font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #0f172a;">sudo apt update  
sudo apt install -y pcscd libccid pcsc-tools  
sudo systemctl enable --now pcscd</span>

## **<span style="font-size: 11.0pt; color: #1a1a2e;">docker</span>**

<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Instale o docker no Ubuntu:</span>

<span style="font-size: 9.0pt; font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #0f172a;">sudo apt install -y ca-certificates curl gnupg  
sudo install -m 0755 -d /etc/apt/keyrings  
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \\  
<span style="mso-spacerun: yes;"> </span>| sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg  
sudo chmod a+r /etc/apt/keyrings/docker.gpg  
echo "deb \[arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg\] \\  
<span style="mso-spacerun: yes;"> </span>https://download.docker.com/linux/ubuntu jammy stable" \\  
<span style="mso-spacerun: yes;"> </span>| sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null  
sudo apt update  
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin  
sudo usermod -aG docker "$USER"<span style="mso-spacerun: yes;"> </span>\# faça logout/login para o grupo ter efeito</span>

<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Teste o docker com:</span>

<span style="font-size: 9.0pt; font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #0f172a;">sudo docker run --rm hello-world</span>

# **<span style="font-size: 13.0pt; color: #1b4fd6;">Instalação do a3-proxy-go</span>**

<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Faça o download das 2 versões disponíveis do nosso container com:</span>

<span style="font-size: 9.0pt; font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #0f172a;">sudo docker pull southamerica-east1-docker.pkg.dev/oystr-presto-test/presto-public/a3-proxy-go:&lt;versão-1&gt;  
sudo docker pull southamerica-east1-docker.pkg.dev/oystr-presto-test/presto-public/a3-proxy-go:&lt;versão-2&gt;</span>

**<span style="color: #92400e;"><span style="mso-spacerun: yes;"> </span>Atenção: </span>**<span style="color: #92400e;">as tags de versão das imagens (nos comandos docker pull e na imagem do docker run) aparecem truncadas no documento de origem. Substitua &lt;versão-1&gt;, &lt;versão-2&gt; e v1.1.&lt;patch&gt; pelas tags exatas informadas pela equipe do Presto.</span>

<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Após a realização de todos os passos anteriores, você está pronto para rodar o a3-proxy-go. Antes de rodar, é necessário entrar em contato com a nossa equipe e requisitar o id a ser usado. No exemplo abaixo, usamos &lt;id&gt; como exemplo:</span>

<span style="font-size: 9.0pt; font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #0f172a;">sudo docker run -d \\  
<span style="mso-spacerun: yes;"> </span>--name a3-proxy-go \\  
<span style="mso-spacerun: yes;"> </span>--restart unless-stopped \\  
<span style="mso-spacerun: yes;"> </span>-e HOST\_PCSC=1 \\  
<span style="mso-spacerun: yes;"> </span>-e FRP\_NAME=&lt;id&gt; \\  
<span style="mso-spacerun: yes;"> </span>-e POLL\_INTERVAL=5 \\  
<span style="mso-spacerun: yes;"> </span>-e PKCS11\_MODULE=/usr/lib/libaetpkss.so \\  
<span style="mso-spacerun: yes;"> </span>-p 8443:8443 \\  
<span style="mso-spacerun: yes;"> </span>-v /run/pcscd/pcscd.comm:/run/pcscd/pcscd.comm \\  
<span style="mso-spacerun: yes;"> </span>southamerica-east1-docker.pkg.dev/oystr-presto-test/presto-public/a3-proxy-go:v1.1.&lt;patch&gt;</span>

<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">A depender da sua versão de Linux, o parâmetro HOST\_PCSC deve ser alterado segundo a tabela abaixo:</span>

<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" id="bkmrk-host-pcscd-version-h" style="width: 480.0pt; border-collapse: collapse; border: none; mso-border-alt: solid #D1D5DB .25pt; mso-yfti-tbllook: 1184; mso-padding-alt: 0cm .5pt 0cm .5pt; mso-border-insideh: .25pt solid #E5E7EB; mso-border-insidev: .25pt solid #E5E7EB;" width="640"><thead><tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; page-break-inside: avoid;"><td style="width: 170.0pt; border-top: #D1D5DB; border-left: #D1D5DB; border-bottom: #E5E7EB; border-right: #E5E7EB; border-style: solid; border-width: 1.0pt; mso-border-top-alt: #D1D5DB; mso-border-left-alt: #D1D5DB; mso-border-bottom-alt: #E5E7EB; mso-border-right-alt: #E5E7EB; mso-border-style-alt: solid; mso-border-width-alt: .25pt; background: #1B4FD6; padding: 3.0pt 6.0pt 3.0pt 6.0pt;" valign="top" width="227">**<span style="color: white;">Host</span>**

</td><td style="width: 170.0pt; border-top: solid #D1D5DB 1.0pt; border-left: none; border-bottom: solid #E5E7EB 1.0pt; border-right: solid #E5E7EB 1.0pt; mso-border-left-alt: solid #E5E7EB .25pt; mso-border-alt: solid #E5E7EB .25pt; mso-border-top-alt: solid #D1D5DB .25pt; background: #1B4FD6; padding: 3.0pt 6.0pt 3.0pt 6.0pt;" valign="top" width="227">**<span style="color: white;">pcscd version</span>**

</td><td style="width: 140.0pt; border-top: solid #D1D5DB 1.0pt; border-left: none; border-bottom: solid #E5E7EB 1.0pt; border-right: solid #D1D5DB 1.0pt; mso-border-left-alt: #E5E7EB; mso-border-top-alt: #D1D5DB; mso-border-bottom-alt: #E5E7EB; mso-border-right-alt: #D1D5DB; mso-border-style-alt: solid; mso-border-width-alt: .25pt; background: #1B4FD6; padding: 3.0pt 6.0pt 3.0pt 6.0pt;" valign="top" width="187">**<span style="color: white;">HOST\_PCSC</span>**

</td></tr></thead><tbody><tr style="mso-yfti-irow: 1; page-break-inside: avoid;"><td style="width: 170.0pt; border-top: none; border-left: solid #D1D5DB 1.0pt; border-bottom: solid #E5E7EB 1.0pt; border-right: solid #E5E7EB 1.0pt; mso-border-top-alt: solid #E5E7EB .25pt; mso-border-alt: solid #E5E7EB .25pt; mso-border-left-alt: solid #D1D5DB .25pt; background: white; padding: 3.0pt 6.0pt 3.0pt 6.0pt;" valign="top" width="227"><span style="font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #1a1a2e;">Ubuntu 22.04</span>

</td><td style="width: 170.0pt; border-top: none; border-left: none; border-bottom: solid #E5E7EB 1.0pt; border-right: solid #E5E7EB 1.0pt; mso-border-top-alt: solid #E5E7EB .25pt; mso-border-left-alt: solid #E5E7EB .25pt; mso-border-alt: solid #E5E7EB .25pt; background: white; padding: 3.0pt 6.0pt 3.0pt 6.0pt;" valign="top" width="227"><span style="font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #1a1a2e;">1.9.x</span>

</td><td style="width: 140.0pt; border-top: none; border-left: none; border-bottom: solid #E5E7EB 1.0pt; border-right: solid #D1D5DB 1.0pt; mso-border-top-alt: solid #E5E7EB .25pt; mso-border-left-alt: solid #E5E7EB .25pt; mso-border-alt: solid #E5E7EB .25pt; mso-border-right-alt: solid #D1D5DB .25pt; background: white; padding: 3.0pt 6.0pt 3.0pt 6.0pt;" valign="top" width="187"><span style="font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #1a1a2e;">1</span>

</td></tr><tr style="mso-yfti-irow: 2; page-break-inside: avoid;"><td style="width: 170.0pt; border-top: none; border-left: solid #D1D5DB 1.0pt; border-bottom: solid #E5E7EB 1.0pt; border-right: solid #E5E7EB 1.0pt; mso-border-top-alt: solid #E5E7EB .25pt; mso-border-alt: solid #E5E7EB .25pt; mso-border-left-alt: solid #D1D5DB .25pt; background: white; padding: 3.0pt 6.0pt 3.0pt 6.0pt;" valign="top" width="227"><span style="font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #1a1a2e;">Ubuntu 24.04</span>

</td><td style="width: 170.0pt; border-top: none; border-left: none; border-bottom: solid #E5E7EB 1.0pt; border-right: solid #E5E7EB 1.0pt; mso-border-top-alt: solid #E5E7EB .25pt; mso-border-left-alt: solid #E5E7EB .25pt; mso-border-alt: solid #E5E7EB .25pt; background: white; padding: 3.0pt 6.0pt 3.0pt 6.0pt;" valign="top" width="227"><span style="font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #1a1a2e;">2.0.3</span>

</td><td style="width: 140.0pt; border-top: none; border-left: none; border-bottom: solid #E5E7EB 1.0pt; border-right: solid #D1D5DB 1.0pt; mso-border-top-alt: solid #E5E7EB .25pt; mso-border-left-alt: solid #E5E7EB .25pt; mso-border-alt: solid #E5E7EB .25pt; mso-border-right-alt: solid #D1D5DB .25pt; background: white; padding: 3.0pt 6.0pt 3.0pt 6.0pt;" valign="top" width="187"><span style="font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #1a1a2e;">1</span>

</td></tr><tr style="mso-yfti-irow: 3; page-break-inside: avoid;"><td style="width: 170.0pt; border-top: none; border-left: solid #D1D5DB 1.0pt; border-bottom: solid #E5E7EB 1.0pt; border-right: solid #E5E7EB 1.0pt; mso-border-top-alt: solid #E5E7EB .25pt; mso-border-alt: solid #E5E7EB .25pt; mso-border-left-alt: solid #D1D5DB .25pt; background: white; padding: 3.0pt 6.0pt 3.0pt 6.0pt;" valign="top" width="227"><span style="font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #1a1a2e;">Fedora 41+</span>

</td><td style="width: 170.0pt; border-top: none; border-left: none; border-bottom: solid #E5E7EB 1.0pt; border-right: solid #E5E7EB 1.0pt; mso-border-top-alt: solid #E5E7EB .25pt; mso-border-left-alt: solid #E5E7EB .25pt; mso-border-alt: solid #E5E7EB .25pt; background: white; padding: 3.0pt 6.0pt 3.0pt 6.0pt;" valign="top" width="227"><span style="font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #1a1a2e;">2.3.x</span>

</td><td style="width: 140.0pt; border-top: none; border-left: none; border-bottom: solid #E5E7EB 1.0pt; border-right: solid #D1D5DB 1.0pt; mso-border-top-alt: solid #E5E7EB .25pt; mso-border-left-alt: solid #E5E7EB .25pt; mso-border-alt: solid #E5E7EB .25pt; mso-border-right-alt: solid #D1D5DB .25pt; background: white; padding: 3.0pt 6.0pt 3.0pt 6.0pt;" valign="top" width="187"><span style="font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #1a1a2e;">2</span>

</td></tr><tr style="mso-yfti-irow: 4; mso-yfti-lastrow: yes; page-break-inside: avoid;"><td style="width: 170.0pt; border-top: none; border-left: solid #D1D5DB 1.0pt; border-bottom: solid #D1D5DB 1.0pt; border-right: solid #E5E7EB 1.0pt; mso-border-top-alt: #E5E7EB; mso-border-left-alt: #D1D5DB; mso-border-bottom-alt: #D1D5DB; mso-border-right-alt: #E5E7EB; mso-border-style-alt: solid; mso-border-width-alt: .25pt; background: white; padding: 3.0pt 6.0pt 3.0pt 6.0pt;" valign="top" width="227"><span style="font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #1a1a2e;">macOS</span>

</td><td style="width: 170.0pt; border-top: none; border-left: none; border-bottom: solid #D1D5DB 1.0pt; border-right: solid #E5E7EB 1.0pt; mso-border-top-alt: solid #E5E7EB .25pt; mso-border-left-alt: solid #E5E7EB .25pt; mso-border-alt: solid #E5E7EB .25pt; mso-border-bottom-alt: solid #D1D5DB .25pt; background: white; padding: 3.0pt 6.0pt 3.0pt 6.0pt;" valign="top" width="227"><span style="font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #1a1a2e;">(none)</span>

</td><td style="width: 140.0pt; border-top: none; border-left: none; border-bottom: solid #D1D5DB 1.0pt; border-right: solid #D1D5DB 1.0pt; mso-border-top-alt: #E5E7EB; mso-border-left-alt: #E5E7EB; mso-border-bottom-alt: #D1D5DB; mso-border-right-alt: #D1D5DB; mso-border-style-alt: solid; mso-border-width-alt: .25pt; background: white; padding: 3.0pt 6.0pt 3.0pt 6.0pt;" valign="top" width="187"><span style="font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #1a1a2e;">unsupported</span>

</td></tr></tbody></table>

# **<span style="font-size: 13.0pt; color: #1b4fd6;">Pronto!</span>**

<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Depois de obter o id com a equipe do Presto e rodar o container, você está pronto para configurar o token A3 no nosso cofre.</span>

# **<span style="font-size: 13.0pt; color: #1b4fd6;">Manutenção</span>**

**<span style="font-size: 11.0pt; line-height: 125%; color: #1b4fd6;">1.<span style="mso-spacerun: yes;"> </span></span>**<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Se a máquina estiver desligada, o container do docker parado, ou sem acesso à internet, o acesso ao A3 não funciona e, por consequência, o login via Presto também não.</span>

**<span style="font-size: 11.0pt; line-height: 125%; color: #1b4fd6;">2.<span style="mso-spacerun: yes;"> </span></span>**<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Eventualmente será necessário retirar e recolocar o A3 na máquina. Isso não tem relação com o Presto, mas com o hardware da máquina.</span>

**<span style="font-size: 11.0pt; line-height: 125%; color: #1b4fd6;">3.<span style="mso-spacerun: yes;"> </span></span>**<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Se o container a3-proxy-go tiver problemas, é necessário enviar os logs para a nossa equipe avaliar. Rode: </span><span style="font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #0f172a; background: #F3F4F6;">sudo docker logs --tail 5000 a3-proxy-go</span>

**<span style="font-size: 11.0pt; line-height: 125%; color: #1b4fd6;">4.<span style="mso-spacerun: yes;"> </span></span>**<span style="font-size: 11.0pt; line-height: 125%; color: #1a1a2e;">Caso seja necessário, reinicie o container com: </span><span style="font-family: Consolas; mso-fareast-font-family: Consolas; mso-bidi-font-family: Consolas; color: #0f172a; background: #F3F4F6;">sudo docker restart a3-proxy-go</span>

*<span style="font-size: 8.0pt; color: #6b7280;">Presto · Oystr — Guia de instalação do a3-proxy-go para acesso via token A3 físico.</span>*