×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Registered User
    Join Date
    Nov 2013
    Posts
    24

    Generating self signed certificate in Windows Phone 8

    Is it possible to generate self signed certificate in Windows Phone 8?

    It can be achieved in .Net using Pluralsight's SelfCert library, but since windows phone has its own .Net runtime which is subset of .Net 3.0, SelfCert is not compatible. Is there any way to achieve this? I did some research on using Native code(C++) and ruby code with IronRuby in windows phone but couldn't find much pointers. Any help will be appreciated.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,740

    Re: Generating self signed certificate in Windows Phone 8

    A Google search for OpenSSL WP8 seems to bring some results.

  3. #3
    Registered User
    Join Date
    Nov 2013
    Posts
    24

    Re: Generating self signed certificate in Windows Phone 8

    hey wizard,
    Quote Originally Posted by wizard_hu_ View Post
    A Google search for OpenSSL WP8 seems to bring some results.
    First of all thanks for your help.
    I have already tried this. It does generate a x509 certificate but i don't find a way to convert x509 to x509certificate2, which is the one i need. Do you have any experience with that?

  4. #4
    Registered User
    Join Date
    Nov 2013
    Posts
    24

    Re: Generating self signed certificate in Windows Phone 8

    I am absolutely stuck with this. Any help will be appreciated.

    I am able to compile OpenSSL for windows phone 8 and use it in managed C# code using WinPRT to generate a self signed certificate. But what OpenSSL create is a X509 certificate and i need a X509Certificate2. But we don't have a support for it in windows phone. Any good way to proceed from here? or a workaround? can i somehow compile X509Certificate2 class for windows phone?

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2011
    Location
    Portugal
    Posts
    957

    Re: Generating self signed certificate in Windows Phone 8

    Can you tell us exacly what you have done so far? I dont have much experience with Self Signed certificates on WP but one thing I know... when you have a self signed certificate, you need to install the certificate on WP manually for it to be recognized. One way of doing it is to email the certificate to yourself, open the email on WP and then install the certificate you created.

  6. #6
    Registered User
    Join Date
    Nov 2013
    Posts
    24

    Re: Generating self signed certificate in Windows Phone 8

    Hi Joao
    Quote Originally Posted by joaocardoso View Post
    Can you tell us exacly what you have done so far? I dont have much experience with Self Signed certificates on WP but one thing I know... when you have a self signed certificate, you need to install the certificate on WP manually for it to be recognized. One way of doing it is to email the certificate to yourself, open the email on WP and then install the certificate you created.
    What i am trying to achieve is create a secure channel for communication between my WP8 app and my server. For which I need to create a self signed certificate on the client side(i.e WP8 device). The certificate is not meant for making the server trustable by device which i think applies for the case you mentioned(installing cert on the device). The certificate is for use in the program itself for creating a secure channel.

    What i did till now is took OpenSSL C++ native source code, compiled it for WP8, Used that native library from managed C# code using WinPRT to generate a self signed X509 certificate. Everything is fit and fine until this point. Issue arises when i need to convert that X509 certificate to X509Certificate2 because WP8 do not support it. So can i somehow use X509Certificate2 class, which is there for WinRT apps in my WP8 app?

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2011
    Location
    Portugal
    Posts
    957

    Re: Generating self signed certificate in Windows Phone 8

    Quote Originally Posted by nikita.m View Post
    So can i somehow use X509Certificate2 class, which is there for WinRT apps in my WP8 app?
    I dont think you can. Perhaps this may help (you will need to compile it for WP): http://www.bouncycastle.org/index.html

  8. #8
    Registered User
    Join Date
    Nov 2013
    Posts
    24

    Re: Generating self signed certificate in Windows Phone 8

    Quote Originally Posted by joaocardoso View Post
    I dont think you can
    Thats sad. Very sad!

    Quote Originally Posted by joaocardoso View Post
    . Perhaps this may help (you will need to compile it for WP): http://www.bouncycastle.org/index.html
    I can find bouncy castle for WP8. But how using bouncy castle can help me. I think i will get stuck at the same place(no support for X509certificate2).

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2011
    Location
    Portugal
    Posts
    957

    Re: Generating self signed certificate in Windows Phone 8

    Quote Originally Posted by nikita.m View Post
    I can find bouncy castle for WP8. But how using bouncy castle can help me. I think i will get stuck at the same place(no support for X509certificate2).
    Sorry but I really don't have experience with this. I mentioned bouncy castle because it stated it can generate v1, v2 and v3 X50 certificates.

    On heir website:

    Generators for Version 1 and Version 3 X.509 certificates, Version 2 CRLs, and PKCS12 files.
    Generators for Version 2 X.509 attribute certificates.
    Perhaps someone else can help you with this...

    Couple of questions.

    Why not use a self signed certificate created on a server and then install it to the client devices?

    Oh and a final one. Why not create a real certificate? There are some providers that allows you to create a real digital certificate for about $20-$30 or even free. Example: https://www.startssl.com/

  10. #10
    Registered User
    Join Date
    Nov 2013
    Posts
    24

    Re: Generating self signed certificate in Windows Phone 8

    Quote Originally Posted by joaocardoso View Post
    Sorry but I really don't have experience with this. I mentioned bouncy castle because it stated it can generate v1, v2 and v3 X50 certificates. On heir website:
    These are different versions of X509 certificate. X509Certificate2 is different.

    Quote Originally Posted by joaocardoso View Post
    Perhaps someone else can help you with this...
    I willvbe glad if someone can.
    Quote Originally Posted by joaocardoso View Post
    Couple of questions.

    Why not use a self signed certificate created on a server and then install it to the client devices?

    Oh and a final one. Why not create a real certificate? There are some providers that allows you to create a real digital certificate for about $20-$30 or even free. Example: https://www.startssl.com/
    See the whole point of generating a self signed certificate is to use it for creating a secure session. It has to be different in every session for real security(in my case) because it is used for initial handshake. If i install a certificate on phone it will be static, more ever it can't be accessed from code. Hope i am clear this time.

  11. #11
    Nokia Developer Champion
    Join Date
    Feb 2013
    Location
    Dublin, Ireland
    Posts
    568

    Re: Generating self signed certificate in Windows Phone 8

    Have you asked the question on StackOverflow - it's quite a specific/specialised question and StackOverflow has a huge audience?

  12. #12
    Registered User
    Join Date
    May 2008
    Location
    Surat Thani
    Posts
    260

    Re: Generating self signed certificate in Windows Phone 8

    Quote Originally Posted by nikita.m View Post
    These are different versions of X509 certificate. X509Certificate2 is different.
    I might be wrong, but isn't X509Certificate2 just a .NET class for representing ordinary X509 certificates, not actually a different type of certificate?

  13. #13
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,740

    Re: Generating self signed certificate in Windows Phone 8

    Based on http://stackoverflow.com/questions/1...509certificate, and especially one of its references, http://www.grimes.nildram.co.uk/work...m#2_0_x509Cert X509Certificate2 allows fields from newer certificate versions to be used. Only Nikita.m can tell how important they are for this specific use case. Maybe the server does not accept version 1 certificates at all, that can be a real problem.

  14. #14
    Registered User
    Join Date
    Nov 2013
    Posts
    24

    Re: Generating self signed certificate in Windows Phone 8

    Hey theothernet,
    Quote Originally Posted by theothernt View Post
    Have you asked the question on StackOverflow - it's quite a specific/specialised question and StackOverflow has a huge audience?
    It being a specific/specialized question made me to post it here(community dedicated to WP).

  15. #15
    Registered User
    Join Date
    Nov 2013
    Posts
    24

    Re: Generating self signed certificate in Windows Phone 8

    Hi TongMuan,
    Quote Originally Posted by TongMuan View Post
    I might be wrong, but isn't X509Certificate2 just a .NET class for representing ordinary X509 certificates, not actually a different type of certificate?
    You are indeed right. But X509Certificate2 exposes some methods which aren't present in X509 and that's what causes issues for me.

Similar Threads

  1. SSL certificate validations in Windows Phone
    By lcj_05 in forum Windows Phone General
    Replies: 1
    Last Post: 2013-10-09, 09:50
  2. Windows 8 Phone Client Certificate HTTPS authentication
    By deadlock83 in forum Windows Phone General
    Replies: 0
    Last Post: 2013-03-15, 16:06
  3. j2me Code Signing: Self Signed Certificate VS Unknown Certificate VS No Certificate?
    By Nikolaos in forum Mobile Java Networking & Messaging & Security
    Replies: 6
    Last Post: 2008-11-22, 20:34
  4. Generating self-signed certificate
    By veda_scient in forum Mobile Java Networking & Messaging & Security
    Replies: 15
    Last Post: 2008-01-17, 22:03
  5. Generating certificate from the wap server
    By xz_dollygal in forum WAP Servers
    Replies: 0
    Last Post: 2003-04-07, 10:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×