bc-java icon indicating copy to clipboard operation
bc-java copied to clipboard

Country field with more than two English characters.

Open onepeople158 opened this issue 10 months ago • 1 comments

Main content:
Hello Developer, I have a CRL file where the Country value in the Issuer field is "USA." Normally, ISO 3166-1 specifies two English characters to represent a country name. Bouncy Castle 1.79 successfully printed the Issuer field information of this CRL file without any errors. So I would like to ask if this is a bug.

Version of Bouncy Castle used:

(bcprov-jdk18on-1.79.jar:bcpkix-jdk18on-1.79.jar)

Computer system: Ubuntu

How reproducible:

javac -cp ".:bcprov-jdk18on-1.79.jar:bcpkix-jdk18on-1.79.jar" CRLParserExample_USA_issuer.java
java -cp ".:bcprov-jdk18on-1.79.jar:bcpkix-jdk18on-1.79.jar" CRLParserExample_USA_issuer

Test case:

test_USA.zip

onepeople158 avatar Mar 04 '25 02:03 onepeople158

I would not say this is a bug. Is it useful to do this, another question altogether? It is tempting to try and stop people constructing wrong country codes, but that could well blow up as well - DNs are a bit of a free for all.

dghgit avatar Aug 11 '25 05:08 dghgit