Hi,

Thanks for the reply Pulasthi !!!
I checked the classes and Im referring to buildX500Name() method in [2].
Assuming 'cn' argument I should provide is the raw common name without
custom encoding, bouncy castle will encode it in UTF8 which is default for
CN (rather than PRINTABLE_STRING), isn't it ?

If I miss something here, could you please tell me how I can intentionally
use PRINTABLE_STRING for CN using this method ?

BR


*Asok Aravinda Perera*
Software Engineer
WSO2, Inc.;http://wso2.com/
<http://www.google.com/url?q=http%3A%2F%2Fwso2.com%2F&sa=D&sntz=1&usg=AFQjCNGJuLRux6KkJwXKVUCYOtEsNCmIAQ>
lean.enterprise.middleware

Mobile: +94722241032

On Tue, Jan 27, 2015 at 3:14 PM, Pulasthi Mahawithana <pulast...@wso2.com>
wrote:

> Hi Asok,
>
> You can refer to this class[1] (line 187 onward) on how to sign. you can
> build the X500 name from CN as done in [2] (line 95 onward).
>
> [1]
> https://github.com/pulasthi7/carbon-identity/blob/feature/ca-component/components/identity/org.wso2.carbon.identity.certificateauthority/src/main/java/org/wso2/carbon/identity/certificateauthority/services/CertificateServiceImpl.java
> [2]
> https://github.com/pulasthi7/carbon-identity/blob/feature/ca-component/components/identity/org.wso2.carbon.identity.certificateauthority/src/main/java/org/wso2/carbon/identity/certificateauthority/CSRGenerator.java
>
> On Tue, Jan 27, 2015 at 1:53 PM, Asok Perera <as...@wso2.com> wrote:
>
>> Hi,
>>
>> I'm using bouncycastle for certificate signing process (use
>> X509v3CertificateBuilder), and I need to generate the signed certificate
>> with a CommonName encoded in ASN1 PRINTABLE_STRING format instead of
>> bouncycastle's default - UTF8.
>>
>> Is there a way to do this  ?
>>
>> BR
>>
>>
>> *Asok Aravinda Perera*
>> Software Engineer
>> WSO2, Inc.;http://wso2.com/
>> <http://www.google.com/url?q=http%3A%2F%2Fwso2.com%2F&sa=D&sntz=1&usg=AFQjCNGJuLRux6KkJwXKVUCYOtEsNCmIAQ>
>> lean.enterprise.middleware
>>
>> Mobile: +94722241032
>>
>> _______________________________________________
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Pulasthi Mahawithana*
> Software Engineer
> WSO2 Inc., http://wso2.com/
> Mobile: +94-71-5179022
> Blog: http://blog.pulasthi.org
>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to