bc-java
bc-java copied to clipboard
Bouncy Castle 1.80 handling of escape characters
Hello Developer: I have a CRL file, and the "O" field in its issuer section contains an escape character. The value of the "O" field is 'VeriSign\'. When I use Bouncy Castle 1.80 to parse this CRL file, Bouncy Castle 1.80 interprets the "O" field as 'VeriSign\\'. However, when I open the CRL file as a .crl file, the "O" field in the issuer section shows as 'VeriSign\'. Therefore, I suspect that the handling of the escape character '\\' by Bouncy Castle 1.80 may not be entirely reasonable.
Code:
import java.io.InputStream;
import java.io.FileInputStream;
import org.bouncycastle.asn1.x509.CertificateList;
import org.bouncycastle.cert.X509CRLHolder;
public class CRLParserExample3 {
public static void main(String[] args) throws Exception{
InputStream inputStream = new FileInputStream("crl_file_.der");
X509CRLHolder crlHolder = new X509CRLHolder(inputStream);
System.out.println("Issuer: " + crlHolder.getIssuer());
}
}
Actual results: The issuer field is parsed as Issuer: OU=Class 3 Public Primary Certification Authority,CN=test,O=VeriSign\\,L=test,ST=test,C=US.
Test case: crl_file_.zip