Skip to content

Instantly share code, notes, and snippets.

@weltonrodrigo
Created January 24, 2023 02:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weltonrodrigo/db0a88c676654f03e50d76f49d7e5b9a to your computer and use it in GitHub Desktop.
Save weltonrodrigo/db0a88c676654f03e50d76f49d7e5b9a 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