Email extraction edge case fixed
2 edge cases combined resulted in the wrong email being extracted:
- Email address with
+
in the name part it. (typical case:name.lastname+prefix@gmail.com
) - Certificates with a DN that has fields positioned after the
emailAddress
(GN
andSN
in our case)
So this at the end of the DN failed: emailAdress=firstname.lastname+prefix@gmail.com/GN=firstname/SN=lastname
It resulted in this extracted email address: firstname.lastname+prefix@gmail.com/GN=firstname/SN=lastname
This fixes both issues.
Note that it adds one assumption: there can never be any comma, slash or space in an email address.