Hi,

Tommaso Cucinotta wrote:

Hi,

can you please provide more information about the kind of problem
you are experiencing ?

I.

How are you communicating with the card ?
I guess you are using the MuscleCard API, confirm please.
I see you're using Java. Are you using the JMuscleCard bridge
from Smart Sign ?
What parameters did you feed into ComputeCrypt for signing ?

No. It has nothing to do with Muscle Card.

II.

What is the "returned byte array" you're talking about ?
What function returns it ? And what does it mean "as raw
input for an RSA key pair" ? Are you referring to the Java
Security API (java.security.* / java.crypto.*) for building key
pairs ?

The Java Card API writes the data into the inOutBuffer byte array (with offset 0 in the buffer):


((RSAPublicKey)keyPair.getPublic()).getExponent(inOutBuffer, (short)0);

I construct a similar structure to the keyblob defiitions of the Muscle Card and transmit it.

A key is transfered to the PC and used to reconstruct the key by e.g.:

pubKey = KeyFactory.getInstance("RSA").generatePublic(
new RSAPublicKeySpec(new BigInteger(modulus), new BigInteger(pubExp)));


This key ist not usable. I have tried. I also do not believe I made an error by retrieving the key, because my keys generated at the PC side are working on the card and when I retrieve them I get what I have inserted. The keys from the card are not working. See first mail.


- - - - - - - - - - - - - - - - - -

The problem with with the signing process is that this chain never functions:

----
Creates a Signature object instance of the selected algorithm.

static Signature getInstance(byte algorithm, boolean externalAccess)

----
Initializes the Signature object with the appropriate Key.

abstract void init(Key theKey, byte theMode)

-----
Accumulates a signature of the input data.

abstract void update(byte[] inBuff, short inOffset, short inLength)


Generates the signature of all/last input data.

abstract short sign(byte[] inBuff, short inOffset, short inLength, byte[]sigBuff, short sigOffset)

Bye, Karsten


Without further information, it is impossible for me to help.

Bye,
    T.

Karsten Ohme wrote:

Hello,

I have the following main problems with Cyberflex e-gate 32k:

I.

The signing algorithm with RSA does not function. I get an error from the card. Another corporation I contacted has reported me that this failure is also known to them.

II.

I have problems to generate keys on a Cyberflex e-gate 32k. The operation succeeeds but when I want to use these keys and read it to to my PC I cannot use it with Java applications (I use the byte array returned as raw input for an RSA key pair). I believe that the keys are in a two complement representation but this array is beginning with 80 or something like that. The important thing is that the first position is always greater then 7 which means a negative number. Apart from that when I want to use the key pair generated on the card on the card itself I get an error, which confirms my assumption that this is an error.

Because of these two problems I have to generate the keys on the PC and transfer them. To sign I have to emulate it by building my own message with a right ASN.1 encoding (DER) and encrypting it with the private key. The PCKS padding is done correctly by the card. These signature are valid.

Does anybody has also problems with the cyberflex e-gate 32k?
Can anybody approve my experiences?
Or can it be my fault?

Bye, Karsten

_______________________________________________
Muscle mailing list
[EMAIL PROTECTED]
http://lists.drizzle.com/mailman/listinfo/muscle


--
Sie da!! Schuhputz verbessern! Ausf�hrung! Abflug!

Herr Hauptfeld


_______________________________________________ Muscle mailing list [EMAIL PROTECTED] http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to