Question

There is a web user interface through which user is posting csr text in the website. there is a textbox in which user paste the csr text that is generated by a tool.

Previously i was validating the text , by checking if there is ---Begin Request --- and ---End Request---- present in the text.

But

---Begin Request ---
blah blah 
---End Request----

is not a valid CSr text, But it is validated by my site since it contains the begin and end tag. How can i validate the CSR text, IS there any web api present to which i can send the request and it can validate the request and send the response back.

Was it helpful?

Solution

request = new CX509CertificateRequestPkcs10();
request.InitializeDecode("Actual csr", EncodingType.XCN_CRYPT_STRING_BASE64REQUESTHEADER);

replace "Actual CSR" with the csr provided by the user.

you can use the above method which will validate if it is a valid BASE64 Request or not.(i.e. a valid CSR)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top