Investigate RSAPrivateKey.getEncoded() determinism

Issue #75 resolved
Vladimir Dzhuvinov created an issue

See JUnit test RSAKeyTest.testKeyConversionRoundTrip()

assertEquals("Private RSA", Base64.encode(rsaPrivateKeyIn.getEncoded()).toString(), Base64.encode(rsaPrivateKeyOut.getEncoded()).toString());

Comments (4)

  1. Vladimir Dzhuvinov reporter

    Fix issue #75: Loss of CRT params on RSA keys

    This fixes issue #75, which was caused by the fact that a call to privateKey on RSAKey.Builder would not always use the CRT representation of the private key. This change checks if a key is encoded using CRT, and subsequently calls the proper function. Otherwise, the additional parameters for the CRT encoding would get lost and the resulting PKCS8 encoding of the private keys would not match.

    → <<cset ba1efd1fc96b>>

  2. Vladimir Dzhuvinov reporter

    Fix issue #75: Loss of CRT params on RSA keys

    This fixes issue #75, which was caused by the fact that a call to privateKey on RSAKey.Builder would not always use the CRT representation of the private key. This change checks if a key is encoded using CRT, and subsequently calls the proper function. Otherwise, the additional parameters for the CRT encoding would get lost and the resulting PKCS8 encoding of the private keys would not match.

    → <<cset ba1efd1fc96b>>

  3. Log in to comment