It thereby allows Java applications to interact with applications running on the Smart Card, to store and retrieve data on the card, etc. The API is defined by classes in the package javax.smartcardio. They can be classified as follows. To open a jar file in Windows, you must have the Java Runtime Environment installed. Alternatively, you can use decompression software, such as an unzip utility, to view the files in the jar archive.
I'm trying to sign a pdf with belgian eId smart Card. I've installed Eclipse, downloaded Java SDK 1.6, added the itext 5.4.5 jars smardcardsign-1.0 jars as external jars to the building path.
I want to test example '4.6 signing a string for authentication' from Bruno's whitepaper 'Digital Signature for PDF documents'.
Add Monograms, multi-line text, circular lettering and even spiral lettering using 12 built-in fonts. Embrilliance free download full version.
I copied C4_05_SignWithBEID.java file from itext download site.
I've got an error 'AUTHN_CERT_FILE_ID can not be resolved or is not a field'for line X509Certificate cert = card.readCertificate(BeIDCertificates.AUTHN_CERT_FILE_ID);
When I check the properties for class BeIdCertificates the 'AUTHN_CERT_FILE_ID' is not available.
Has someone a complete source for the example 4.8 signing a document using the EidSignature class ?
1 Answer
Please don't copy/paste from examples I have written without reading the accompanying book, in this case the free eBook 'Digital Signatures for PDF documents'.
The example you mention is taken from section 4.2.2 from that book, entitled 'Extracting data from the Belgian eID using smartcardsign.'
Allow me to quote myself (page 105):
We can use the javax.smartcardio
API to access any smart card, but unfortunately it's usually not that simple. Every card has its own file structure, its own applications, its own data definitions, and so on. Apart from the ISO/IEC specification, you'll always need the specifications of the card you want to use. I've written a small library that wraps the generic Java API classes in objects such as CardReaders
, SmartCard
and SmartCardWithKey
. I wrote a special class for the Belgian eID, named BeIDCard
. You can find this library on SourceForge. It’s meant as a light-weight library that supports only the basic functionality.
You can find the link to that library in the footnotes: http://sourceforge.net/projects/smartcardsign/
Javax Download
The class BeIDCertificates
is part of this library, and it has a constant named AUTHN_CERT_FILE_ID
.