Hi Tharinda,

What's the Kernel version in which you want to do this? In Kernel 4.2.0,
the SSL certificate was stored in the Keystore defined in carbon.xml
(<KeyStore>) and it can be retrieved using the methods mentioned in this
thread.
But if you are using Kernel 4.4.x, the keystore for the SSL certificate is
defined in catalina-server.xml (same as tomcat) [1]. Here if you use the
above method, you will retrieve the certificate which is used for
encrypting [2].

[1] -
https://docs.wso2.com/display/Carbon440/Configuring+catalina-server.xml
[2] -
https://docs.wso2.com/display/Carbon440/Configuring+Keystores+in+WSO2+Products

Regards,
Nira

On Thu, Feb 18, 2016 at 11:14 AM, Thusitha Thilina Dayaratne <
thusit...@wso2.com> wrote:

> Hi Tharinda,
>
> You can refer to
> https://github.com/wso2/carbon-kernel/blob/4.4.x/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/util/KeyStoreManager.java
> It contains teh method to get privateKey as well getDefaultPrivateKey,
> getPrivateKey(String keyStoreName, String alias)
>
>
> On Thu, Feb 18, 2016 at 11:10 AM, Tharinda Ehelepola <tharin...@wso2.com>
> wrote:
>
>> Hi Godwin,
>>
>> That's what I need. And also I need to access the private key. Can you
>> please share any code example on git relevant for this.
>>
>> Thanks,
>> Tharinda.
>>
>> On Thu, Feb 18, 2016 at 10:57 AM, Godwin Shrimal <god...@wso2.com> wrote:
>>
>>> Hi Tharinda,
>>>
>>> If you need to do this in carbon runtime, you can use KeyStoreManager
>>> class as follows to get public certificate of the keystore in super and
>>> other tenants.
>>>
>>> KeyStoreManager.getInstance(tenantID).getDefaultPublicKey();
>>>
>>>
>>> Thanks
>>> Godwin
>>>
>>> On Thu, Feb 18, 2016 at 10:42 AM, Tharinda Ehelepola <tharin...@wso2.com
>>> > wrote:
>>>
>>>> Hi ,
>>>>
>>>> According to the subject I need to access EMM public key certificate
>>>> which is stored in "wso2carbon.jks". How can I do it?
>>>>
>>>> Regards,
>>>> Tharinda.
>>>> --
>>>>
>>>> *Tharinda Ehelepola*
>>>>
>>>> *Software Engineering Intern*
>>>> LinkedIn <https://lk.linkedin.com/in/tharindadilshan>
>>>> TP :      94711834769
>>>> Email: tharin...@wso2.com
>>>> Web: tharinda.tk
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> Dev@wso2.org
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>> *Godwin Amila Shrimal*
>>> Senior Software Engineer
>>> WSO2 Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> mobile: *+94772264165*
>>> linkedin: *http://lnkd.in/KUum6D <http://lnkd.in/KUum6D>*
>>> twitter: https://twitter.com/godwinamila
>>>
>>
>>
>>
>> --
>>
>> *Tharinda Ehelepola*
>>
>> *Software Engineering Intern*
>> LinkedIn <https://lk.linkedin.com/in/tharindadilshan>
>> TP :      94711834769
>> Email: tharin...@wso2.com
>> Web: tharinda.tk
>>
>> _______________________________________________
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Thusitha Dayaratne
> Software Engineer
> WSO2 Inc. - lean . enterprise . middleware |  wso2.com
>
> Mobile  +94712756809
> Blog      alokayasoya.blogspot.com
> About    http://about.me/thusithathilina
>
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

*Niranjan Karunanandham*
Senior Software Engineer - WSO2 Inc.
WSO2 Inc.: http://www.wso2.com
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to