Reputation: 21
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.
Upvotes: 2
Views: 86