mardi 8 juillet 2008

The IAIK JCE Provider

I talked earlier about the Provider abstract class. There can be different implementations of that abstract class. The toolkit from certipost came with an implementation of the PKCS#11 Provider made by IAIK (Institute for Applied Information Processing and Communication). I'll be working with that provider to manage eID authentication.

The CD received from certipost doesn't contain much information on how to use this provider (anyways, I couldn't locate that information on the CD). The IAIK website does have a javadoc of the provider's API however the javadoc alone is not really sufficient to understand how to use the provider.



There was a link to some user guide in the javadoc, but the link was dead. Fortunately, through some clever google shenanigans I eventually found the document.


This contains a lot of very useful information and I'm starting to see how this will all fit in an actual program. Looking at the sample codes provided by certipost, I now start to have a better understanding of some strange programming choices. I can feel your curiosity :-) Here is a sample code that looked really strange:

Security.insertProviderAt
(new iaik.pkcs.pkcs11.provider.IAIKPkcs11(), 2);
Security.addProvider(new iaik.security.provider.IAIK());
Basically what this does is register which provider implementation is going to be used. The strange thing about this is that the first provider is inserted at the second position, and then the second one is added at the next position (ie. the third position). It turns out that the reason for this implementation is that there is a bug in java 1.4 that prevents inserting a provider at the first position.

Funny :-)

Now though I really have a lot to do yet to be ready for tomorow's presentation to the bosses :-( good new is I finally start to feel like I'm understanding things rather than hovering above a massive uncharted rainforest of knowledge.

Aucun commentaire: