Click here to Skip to main content
15,395,390 members
Articles / Programming Languages / Visual Basic
Posted 15 Feb 2012

Tagged as


44 bookmarked


Rate me:
Please Sign up or sign in to vote.
4.86/5 (17 votes)
15 Feb 2012CPOL3 min read
Skypekit API for .NET


Skypekit API and Tutorials


Some developers today tend to use Skypekit in their applications to make it more interactive with the user. Skype API is very awesome indeed but the problem is it is only available in C++, Java and Python. I can't understand why Microsoft didn't develop API for .NET so we can develop it in C# or VB.NET.

I'm one of those, I needed to embed Skype into my graduation project and after I paid the 5$ fees and downloaded the SDK and Runtime I was surprised when I found that there is no support for the .NET languages.

So, the only way I found is to convert C++ methods into a COM component then I can call it in C# using DLLImport. And I spent weeks trying to do this solution but all in vain.

A punch of errors came to my face when I tried to create a new C++ project away from their pre-made tutorials. I was very sad with this result.

I tried to do it in Python but for some reason the socket couldn't make the connection to Skype.

Then I found the magic tool IKVM.


IKVM is a tool that is used to convert Java Applications to .NET Executables (.exe) and Assemblies (.dll).

I used it to convert the Skype Class in their ready-made Java Classes into a .NET 'skypekit' class

Then I manually converted all the Java utilities Code to their corresponding C# code including:

  • AppKeyPairMgr Class
  • Listeners Class
  • MySession Class
  • ParseSkypeKitVersion Class
  • PrintStream Class
  • SignInMgr Class
  • XmlStrMgr Class

And I added an additional Class containing the variables needed and the two main variables which are:

  • myAppKeyPairMgr
  • mySession

I then managed to use Skypekit in my C# application very easy and I could access all its features.

In the uploaded project I included all the 12 Java tutorials done in C# to assure that my .NET DLL is working.

Using the code

To use it, First you have to add the following references:
  1. IKVM.OpenJDK.Core.dll : Java main classes converted to .NET
  2. IKVM.OpenJDK.Security.dll : Java Security Classes (needed for the PrivateKey Class and X509Certificate Class)
  3. IKVM.OpenJDK.Text.dll (Rarely Needed) : Needed for the DateFormat Class
  4. IKVM.Runtime.dll : IKVM Runtime libraries
  5. skypekit.dll : Skype Main Class converted from Java Jar Application using IKVM
  6. Skypekit.NET.dll : My classes created manually based on Java classes

And this is an example of a C# code To make Login

public SkypeMain skypeMain;
public void Login(string user, string pass)
            skypeMain = new SkypeMain();
            if ((!skypeMain.myAppKeyPairMgr.resolveAppKeyPairPath()) ||

            skypeMain.mySession.doCreateSession(skypeMain.MY_CLASS_TAG, user, skypeMain.myAppKeyPairMgr.getPemFilePathname());

            if (skypeMain.mySession.mySignInMgr.Login(skypeMain.MY_CLASS_TAG, skypeMain.mySession, pass))
                //Do Something

Remember to Do these step before running any Skype application.

  1. Download your Keypair (*.pem)
  2. execute
    openssl pkcs8 -topk8 -nocrypt -inform PEM -outform DER -in myKeyPair.pem -out myKeyPair.der 

    to create the certificate file (*.dem)
  3. [Optional] Change the variable KEY_PAIR_DEFAULT_PATHNAME in AppKeyPairMgr class to the path of your .pem keypair file to make it a constant in your app and then re-build the library. Or you can just pass the file path in the main arguments.
  4. Make sure that skype runtime console is running before you run your app.

Points of Interest

I learnt a lot from this painful experiences. So, I need you to know that every problem has a solution but needs some patience and deep thinking.

I reached this powerful and complete solution after weeks of search and thinking.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Technical Lead Paymob Solutions
Egypt Egypt
Educated at Computer Science & Information College, Mansoura University, Egypt
Set up a software development company "Perfect Code" which was in the name "Ahmedn1" or "AN1Soft"

Working with:
C#, VB.NET, ASP.NET, PHP, Windows Phone applications, Java, Python

My quote in life is
To Be Or Not To Be

Comments and Discussions

QuestionWorks with skype for business? Pin
Alu8817-May-16 11:11
MemberAlu8817-May-16 11:11 
Questioni want to know about keypair ? and how to change it Pin
Member 933229327-Feb-15 22:29
MemberMember 933229327-Feb-15 22:29 
QuestionDownload your Keypair (*.pem) Pin
alex giulio22-Sep-14 4:25
Memberalex giulio22-Sep-14 4:25 
AnswerRe: Download your Keypair (*.pem) Pin
Ahmedn15-Nov-14 11:48
MemberAhmedn15-Nov-14 11:48 
GeneralRe: Download your Keypair (*.pem) Pin
alex giulio5-Nov-14 15:30
Memberalex giulio5-Nov-14 15:30 
AnswerRe: Download your Keypair (*.pem) Pin
Miklo B18-Jan-15 12:27
MemberMiklo B18-Jan-15 12:27 
GeneralRe: Download your Keypair (*.pem) Pin
Ahmedn114-Feb-15 9:49
MemberAhmedn114-Feb-15 9:49 
QuestionGreat and Hard Job was Put on this amazing App! Pin
Miklo B6-Apr-14 14:21
MemberMiklo B6-Apr-14 14:21 
AnswerRe: Great and Hard Job was Put on this amazing App! Pin
Ahmedn13-Jul-14 13:40
MemberAhmedn13-Jul-14 13:40 
GeneralRe: Great and Hard Job was Put on this amazing App! Pin
Miklo B21-Aug-14 17:20
MemberMiklo B21-Aug-14 17:20 
QuestionSkype not allowing new developers. Pin
Ravuri Vasu1-Sep-13 7:19
MemberRavuri Vasu1-Sep-13 7:19 
AnswerRe: Skype not allowing new developers. Pin
Ahmedn11-Sep-13 11:50
MemberAhmedn11-Sep-13 11:50 
Questionskype keypair alternative Pin
p_m_durrant23-Apr-13 4:00
Memberp_m_durrant23-Apr-13 4:00 
QuestionEgyptians rule dude :D Pin
Poma3711-Feb-13 6:31
MemberPoma3711-Feb-13 6:31 
QuestionKeypair making Pin
kalpesh280420-Nov-12 20:34
Memberkalpesh280420-Nov-12 20:34 
AnswerRe: Keypair making Pin
Ahmedn121-Nov-12 20:07
MemberAhmedn121-Nov-12 20:07 
GeneralRe: Keypair making Pin
mwechter31-Dec-12 12:45
Membermwechter31-Dec-12 12:45 
I know this is going to sound like a rehash.. but...

1). I downloaded a developer key pair from the "SkypeKit for Desktop" page for my project and I received a PEM file
2). I converted it to a DER certificate using both openSSL and No problems with the conversions.
3). Using Tutorial1 I set the public AppKeyPairMag.pemFilePathname to the location of the converted DER file.
4). The isValidCertificate always fails on the getCertificate call with an exception " Missing or malformed certificate data."

Looking at the rest of the API, I do not see any other problems yet, but I need to get authentication started.
Michael Wechter

GeneralRe: Keypair making Pin
Ahmedn123-Jan-13 12:20
MemberAhmedn123-Jan-13 12:20 
Questionskypekit.NET in Web MVC? Pin
Member 235697721-Sep-12 9:17
MemberMember 235697721-Sep-12 9:17 
AnswerRe: skypekit.NET in Web MVC? Pin
Ahmedn116-Oct-12 14:42
MemberAhmedn116-Oct-12 14:42 
Question.pem file Pin
Soheil Mehralian10-Sep-12 6:20
MemberSoheil Mehralian10-Sep-12 6:20 
AnswerRe: .pem file Pin
Ahmedn116-Oct-12 14:44
MemberAhmedn116-Oct-12 14:44 
QuestionRe: .pem file Pin
p_m_durrant22-Apr-13 3:54
Memberp_m_durrant22-Apr-13 3:54 
AnswerRe: .pem file Pin
Ahmedn129-May-13 11:01
MemberAhmedn129-May-13 11:01 
GeneralRe: .pem file Pin
p_m_durrant2-Jun-13 22:52
Memberp_m_durrant2-Jun-13 22:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.