Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for '&' when verifying valid ASN.1 printable string value #6

Conversation

JoaquinRuiz7
Copy link

@JoaquinRuiz7 JoaquinRuiz7 commented May 26, 2022

Hi sir, great library!

I was having some trouble while checking for the certificate status when string values contained the "&" character.
Exploring the code I bumped into that regex that excludes the character in question, I added "&" to the regex validation.

Works great!

Have a nice day!

@mlocati
Copy link
Owner

mlocati commented May 27, 2022

The standard does not include the & character: see https://www.itu.int/rec/T-REC-X.680-202102-I/en and in particular page 87 of the PDF you can download from that page, where we have:

immagine

It's also mentioned in Wikipedia:

The PrintableString definition does not include the at sign (@) or ampersand (&). This sometimes causes problems for naive implementers who attempt to put an SMTP email address into an X.509 digital certificate Distinguished Name.

@JoaquinRuiz7
Copy link
Author

Great, thanks for he info. Im closing this pull request then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants