Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rduarte/14f9ac98318fb1d0da1df5001792afc9 to your computer and use it in GitHub Desktop.
Save rduarte/14f9ac98318fb1d0da1df5001792afc9 to your computer and use it in GitHub Desktop.
Como gerar um certificado ICP-Brasil A3 (pessoa física) para testes

O formato do certificado ICP-Brasil está disponível nas políticas das autoridades certificadoras autorizadas pelo ICP-Brasil. Exemplo: https://repositorio.acdigital.com.br/docs/pc-a3-ac-digital-multipla.pdf

Ver item 7.1.2.3.a.

Para certificado CNPJ, o procedimento é parecido, só montar os campos de acordo com o item 7.1.2.3.b

openssl req -new -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 \
-subj '/C=BR/O=ICP-Brasil/OU=AC DIGITAL Múltipla G1/OU=33989214000191/OU=presencial/OU=Certificado PF A3/CN=Fulano de tal:58765136012' \
-addext subjectAltName=\
otherName:2.16.76.1.3.1\;UTF8:171219535876513601242586038731001002005784212000000SSPRS,\
otherName:2.16.76.1.3.6\;UTF8:253764977686,\
otherName:2.16.76.1.3.5\;UTF8:465555610469001047700000000000municipioRS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment