...
We strongly recommend that service providers confirm all communications that take place with Auðkenni's system.
Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
What do I need to confirm?
...
Code Block |
---|
private bool validatePKCS1Signature(string signatureFromAudkenni, string hashStringFromAuthenticationRequest, string usersCertFromAudkenni) { byte[] orgHash = null; byte[] signedHash = null; byte[] certBytes = null; X509Certificate2 certificate = null; try { orgHash = Convert.FromBase64String(hashStringFromAuthenticationRequest); signedHash = Convert.FromBase64String(signatureFromAudkenni); certBytes = Convert.FromBase64String(usersCertFromAudkenni); certificate = new X509Certificate2(certBytes); RSA key = (RSA)certificate.PublicKey.Key; RSAPKCS1SignatureDeformatter formatter = new RSAPKCS1SignatureDeformatter(key); formatter.SetHashAlgorithm("SHA512"); var result = formatter.VerifySignature(orgHash, signedHash); return result; } catch (CryptographicException e) { return false; } } |
To verify Certificate
To verify that the user's certificate you receive in the response is correct, you can use our intermediate certificate and the root certificate
For Testing environment:
Intermediate certificate: https://repo.audkenni.is/Skilriki/certs/FAP2021test.cer
Root certificate: https://repo.audkenni.is/Skilriki/certs/IslandsrotTest2021.cer
More details here: https://repo.audkenni.is/Skilriki/profanir.cfm
For Production environment:
Intermediate certificate:
Fullgilt audkenni 2021 - Valid from 09.09.2021 to 09.09.2036: https://skrar.audkenni.is/skilrikjakedjur/islandsrot/Fullgiltaudkenni2021.cer
Fullgilt audkenni - Valid from 16.11.2017 to 16.11.2032: https://skrar.audkenni.is/skilrikjakedjur/islandsrot/older/Milliskilriki.cer
More details here: https://repo.audkenni.is/Skilriki/milliskilriki.cfm
Root certificate:
Islandsrot 2021 - Valid from 09.09.2021 to 09.09.2051: https://skrar.audkenni.is/skilrikjakedjur/islandsrot/Islandsrot2021.cer
Islandsrot - Valid from 02.12.2015 to 02.12.2055: https://skrar.audkenni.is/skilrikjakedjur/islandsrot/older/Islandsrot.cer
More details here: https://repo.audkenni.is/Skilriki/rotarskilriki.cfm