[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iaik-jce] Chinese problem in analysing certificate request and signing certificate



I have a certificate request that includes a common name (CN )in Chinese( GB2312 ). But I use Name.getRDN(ObjectID.commonName) to get the common name field from the request, I get wrong code, not GB2312 string:
 
Name subject = certificateRequest.getSubject();
String commonName=subject.getRDN(ObjectID.commonName);//get wrong string (\xFD\xFD\xFD\xFD), not the original string (\xD1\xEE \xD1\xEE) in Chinese (GB2312).
 
I use X509Certificate.sign(...) to sign the request, the common name field of the signed certificate is wrong, not the original string in Chinese( GB2312 ) too.
 
I've attached a sample certificate request whose subject is:
    Subject: C=US, ST=Unknown, L=Unknown, O=Unknown, OU=Unknown, CN=\xD1\xEE \xD1\xEE/Email=hhfdjk@jrf.rtgf
 
 
-----BEGIN CERTIFICATE REQUEST-----
MIIBxDCCAS0CAQAwgYUxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdVbmtub3duMRAw
DgYDVQQHEwdVbmtub3duMRAwDgYDVQQKEwdVbmtub3duMRAwDgYDVQQLEwdVbmtu
b3duMQ4wDAYDVQQDFAXR7iDR7jEeMBwGCSqGSIb3DQEJARYPaGhmZGprQGpyZi5y
dGdmMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCirKz4a9yq4HpqLuGgOfn0
iPCctXaK74EUb8Tps0bJB7AOVplnFJFVxVIozur761qGDfqaWQI4c5rw3p+IqU8k
KQgOj7E1T54rPjAnUVONsGX67JqaRHtqbSQdB5RcP3BALod2FhH+1wMyQlIlaTqe
Bt0dk2emfyR1HWhOSi5XVwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBADpEPqZ33MQW
RIaDWJA+VlINyIc4o/SjIykiFc9MF1f/0qkE7Elv1U8VDfhLtCLanEJ4cpmr2ADF
TEmgb2HQQExiHwFlxpHDOO7dY1BMv6Treku/uq8nzCMkGwigNxsAhojtGgEjF6OT
51e1n+ibXfO75dRRFOkZU3PaCZZIEmHl
-----END CERTIFICATE REQUEST-----
 
Any suggestion would be really appreciated

Thanks in advance.
 
Kind regards,
 
Albert