2

I'm trying to get the challengePassword attribute from a CSR using Go. I've verified that the challengePassword attribute exists using openssl req -in test.csr -noout -text.

Below is the code snippet I'm using to print an array containing all attributes, omitting err checking. Can anyone point me in the right direction?

block, _ := pem.Decode(csrData)
csr, err := x509.ParseCertificateRequest(block.Bytes)

fmt.Println(csr.Extensions)

This simply returns []. Where I would have expected to get an array containing extensions/attributes in the CSR and their associated values.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Patrick H.
  • 21
  • 1
  • 1
    Go Play for reference example https://go.dev/play/p/e2QLvw0bT7X – Patrick H. Apr 27 '23 at 17:03
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – AthulMuralidhar May 08 '23 at 15:36

0 Answers0