Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexiprovider Integration: MeRSA Keypair creation fails #48

Closed
antidote2 opened this issue Feb 11, 2013 · 3 comments
Closed

Flexiprovider Integration: MeRSA Keypair creation fails #48

antidote2 opened this issue Feb 11, 2013 · 3 comments

Comments

@antidote2
Copy link
Contributor

Cannot create MeRSA Keypair (MpRSA works fine) seems to be Flexiprovider issue or MeRSA does not like the parameters we provide.

To Reproduce click on "create new keypair" in keystore view, select MeRSA and enter password, click next.

java.security.KeyStoreException
at com.sun.crypto.provider.JceKeyStore.engineSetKeyEntry(JceKeyStore.java:283)
at java.security.KeyStoreSpi.engineSetEntry(KeyStoreSpi.java:536)
at java.security.KeyStore.setEntry(KeyStore.java:1326)
at org.jcryptool.crypto.keystore.backend.KeyStoreManager.addKeyPair(KeyStoreManager.java:237)
at org.jcryptool.crypto.keystore.ui.actions.AbstractKeyStoreAction.addKeyPairStatic(AbstractKeyStoreAction.java:75)
at org.jcryptool.crypto.keystore.ui.actions.AbstractKeyStoreAction.addKeyPair(AbstractKeyStoreAction.java:82)
at org.jcryptool.crypto.keystore.ui.actions.AbstractNewKeyStoreEntryAction.performNewKeyAction(AbstractNewKeyStoreEntryAction.java:24)
at org.jcryptool.crypto.flexiprovider.keystore.actions.NewKeyPairAction.access$0(NewKeyPairAction.java:1)
at org.jcryptool.crypto.flexiprovider.keystore.actions.NewKeyPairAction$1.run(NewKeyPairAction.java:119)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

@ghost
Copy link

ghost commented Dec 28, 2013

The parameters provided are fine. This is a FexiProvider issue due to a faulty constructor:

The instance of PrivateKey (in this case an instance of MeRSAPrivateKey) with which addKeyPair is called has got a member variable k (the exponent) that is null. The reason for this is that in the constructor

protected MeRSAPrivateKey(FlexiBigInt n, FlexiBigInt e, FlexiBigInt d,
FlexiBigInt p, FlexiBigInt q, FlexiBigInt dP, FlexiBigInt dQ,
FlexiBigInt crtCoeff, FlexiBigInt k, FlexiBigInt eInvP) {
super(n, e, d, p, q, dP, dQ, crtCoeff);
this.eInvP = eInvP;
this.crtCoeff = crtCoeff;
}

k is not set.

After setting a value for k (e. g. new de.flexiprovider.common.math.FlexiBigInt("1")) in debug mode a key pair is generated and displayed in the keystore view.

@dschadow
Copy link
Member

Forwarded to FP developers, requires new FP release.

@dschadow
Copy link
Member

Fixed with FlexiProvider 1.7.0p7

@ghost ghost assigned dschadow Jan 24, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants