6465666768697071727374
{ harness.checkPoint("testUnknownKeyPairCodec"); kp = kpg.generate(); GnuRSAPublicKey pubK = (GnuRSAPublicKey) kp.getPublic(); try { ((GnuRSAPublicKey) pubK).getEncoded(0); harness.fail("Public key succeeded with unknown format ID"); }
949596979899100101102
} } private void setUp() throws Exception { publicK = new GnuRSAPublicKey(1, n, e); privateK = new GnuRSAPrivateKey(1, n, e, d, p, q, dP, dQ, qInv); cipher = Cipher.getInstance(transformation, GNU); }
233234235236237238239
*/ private GnuRSAPublicKey decodeRSAPublicKey(RSAPublicKeySpec spec) { BigInteger n = spec.getModulus(); BigInteger e = spec.getPublicExponent(); return new GnuRSAPublicKey(Registry.X509_ENCODING_ID, n, e); }