Hi,
I’ve followed the steps line by line on the Application Restricted Restful APIS Signed JWT Authentication documentation here - https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication#environments-and-testing
Unfortunately after cloning the csharp repo and setting the appropriate environment variables I’m getting an exception. I’m not sure if the following lines are necessary, as the generated keys have BEGIN PRIVATE KEY, without RSA. I’m not sure if this is this issue or not. Here is the reference to these lines of code:
privateKey = privateKey.Replace("-----BEGIN RSA PRIVATE KEY-----", "");
privateKey = privateKey.Replace("-----END RSA PRIVATE KEY-----", "");
Either way, the exception I’m getting is on line 72 of the JWTHandler.
System.Security.Cryptography.CryptographicException: ‘ASN1 corrupted data.’
AsnContentException: The provided data is tagged with ‘Universal’ class value ‘16’, but it should have been ‘Universal’ class value ‘2’.
Would anyone be able to point me in the right direction on this one?
Many thanks