Click here to Skip to main content
Click here to Skip to main content

Skypekit.NET

By , 15 Feb 2012
 

Download

Skypekit API and Tutorials

Introduction

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.

Background

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.myAppKeyPairMgr.isValidCertificate()))
            {
                return;
            }

            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.

License

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

About the Author

Ahmedn1
CEO Perfect Codes
Egypt Egypt
Member
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

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
Questionskype keypair alternativememberp_m_durrant23 Apr '13 - 4:00 
i have been trying to get a key pair from skype for two weeks now, and still there is no button on my projects page to generate a key pair, can i convert a standard code signing cert or does it have to be a skype generated key pair
QuestionEgyptians rule dude :DmemberPoma3711 Feb '13 - 6:31 
I will give this a try
QuestionKeypair makingmemberkalpesh280420 Nov '12 - 20:34 
how can i make keypair using Skypekit ?
 
thanks
 
Kalpesh
AnswerRe: Keypair makingmemberAhmedn121 Nov '12 - 20:07 
keypairs are only created from your developer account on Skype website
and then you create the certificate file using the 4 steps I mentioned
 
Download your Keypair (*.pem)
execute
Collapse | Copy Code
 
openssl pkcs8 -topk8 -nocrypt -inform PEM -outform DER -in myKeyPair.pem -out myKeyPair.der
 

to create the certificate file (*.dem)
[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.
Make sure that skype runtime console is running before you run your app.
GeneralRe: Keypair makingmembermwechter31 Dec '12 - 12:45 
Ahmedn1
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 https://www.sslshopper.com/ssl-converter.html. 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 "java.security.spec.InvalidKeySpecException: 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
michael@AdaptiveVoice.com

GeneralRe: Keypair makingmemberAhmedn123 Jan '13 - 12:20 
Don't know there must be something wrong
but the steps you mentioned are the right ones so it should work
Questionskypekit.NET in Web MVC?memberMember 235697721 Sep '12 - 9:17 
Hi Ahmedn1,
First of all congratulations for your SkypeNet library...that's great!
 
Do you have already used your library in a MVC ASP.NET web application?
Do you have any example which I can analyze?
 
I need to integrate in a google maps marker dialog a video or chat session with remote user (marker owner).
 
Thanks in advance.
 
lufer
AnswerRe: skypekit.NET in Web MVC?memberAhmedn116 Oct '12 - 14:42 
there are examples attached with the files but I didn't test it as a web application yet
Question.pem filememberSoheil Mehralian10 Sep '12 - 6:20 
how i can download (or create) my own .pem file?! is it necessary to run SkypeIt code?!
Soheil Mehralian

AnswerRe: .pem filememberAhmedn116 Oct '12 - 14:44 
https://www.sslshopper.com/ssl-converter.html[^]
 
this site enables you to convert certificates to .pem files
QuestionRe: .pem filememberp_m_durrant22 Apr '13 - 3:54 
i have been trying to get a key pair from skype for two weeks now, and still there is no button on my projects page to generate a key pair, can i convert a standard code signing cert or does it have to be a skype generated key pair
QuestionText Chat using Skypekitmemberthirusns10 Aug '12 - 1:55 
Skepekit given the java,pythan,c++ wrapper classes only.But I need to use my PHP Website.
How to make the Skype chat using PHP?. I searched more than a week. But not yet get the results.Please reply.
 
Thanks in advance
AnswerRe: Text Chat using SkypekitmemberAhmedn116 Oct '12 - 14:45 
as I said before I didn't test it as a web application yet
QuestionC++/CLI ?memberDumitru Frunza17 May '12 - 9:01 
I think a C++/CLI layer would be the closest and thinnest C# <-> C++ layer.
QuestionSpeech-Suport only? No Video correct?memberSebastianUw6 May '12 - 23:44 
Hi there,
 
i tried it and it is an really really good project.
 
Only one big disadvantage... it do not support video, only speech conversation. Is that correct or do i a mistake.
 
Thanks for reply!
AnswerRe: Speech-Suport only? No Video correct?memberAhmedn18 May '12 - 13:23 
I did only the samples and tutorials described in SkypeKit site
but I'm sure that there are functions for the Video conversation
here you can view them and how to deal with them
 
https://developer.skype.com/skypekit/development-guide/audio-video-integration/audio-video-primer[^]
AnswerRe: Speech-Suport only? No Video correct?memberAhmedn18 May '12 - 13:24 
https://developer.skype.com/skypekit/development-guide/audio-video-integration/desktop-video-with-qt[^]
QuestionCant find skypekit.dll or skypekit.NET.dllmemberAlan Kidd27 Apr '12 - 10:00 
Hi
 
I am trying to add references to skypekit.dll or skypekit.NET.dll but I can't find them in the extracted archive.
 
Where can I find these?
 
Thanks
 
akidd97
AnswerRe: Cant find skypekit.dll or skypekit.NET.dllmemberAhmedn18 May '12 - 13:25 
you can find them in the debug folder of the project
QuestionerrorsmemberMember 867747825 Feb '12 - 10:24 
I'm impressed by your effort. I've downloaded the project and tutorials and run the project on visual C# express 2010 ... I've added the mentioned references, but still I have a lot of errors like "The type or namespace 'skype' does not exist in the namespace 'com' (are you missing an assembly reference?)" ... am i missing something ...
 
sorry if the question is trivial, i am new to c# programming.
AnswerRe: errorsmemberAhmedn126 Feb '12 - 4:47 
this error is because you forgot to add skypekit.dll
you have to add this
QuestionCool did not know IKMVmemberNicolas Dorier15 Feb '12 - 20:58 
Ingenious and interesting way to migrate code from one language to another... the simpler the better !
 
I did not vote because your article is too short but it would be a cool trick.
AnswerRe: Cool did not know IKMVmemberAhmedn117 Feb '12 - 16:38 
it is IKVM not IKMV Smile | :)
GeneralMy vote of 5memberАslam Iqbal15 Feb '12 - 20:19 
good
QuestionKeep it up...memberaamironline15 Feb '12 - 16:44 
Good one Ahmed, keep it up.
Mohamed Aamir Maniar is a software enthusiastic and founder of Maniar Technologies Pvt Ltd.

These days he keeps himself busy in improving his technology update website www.technobits.net - Latest buzz tips and tricks in Software development.

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

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130523.1 | Last Updated 16 Feb 2012
Article Copyright 2012 by Ahmedn1
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid