From 92e779257df8a0b9d0a9d520e8c738ab777bc147 Mon Sep 17 00:00:00 2001 From: Justin Richer Date: Mon, 30 Jul 2012 13:40:20 -0400 Subject: [PATCH] testing key sizes, still failing outside of bouncycastle --- .../main/java/org/mitre/jwt/encryption/impl/RsaEncrypter.java | 2 +- .../mitre/jwe/encryption/impl/RsaEncrypterDecrypterTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openid-connect-common/src/main/java/org/mitre/jwt/encryption/impl/RsaEncrypter.java b/openid-connect-common/src/main/java/org/mitre/jwt/encryption/impl/RsaEncrypter.java index 7946fdf78..06bf46c0d 100644 --- a/openid-connect-common/src/main/java/org/mitre/jwt/encryption/impl/RsaEncrypter.java +++ b/openid-connect-common/src/main/java/org/mitre/jwt/encryption/impl/RsaEncrypter.java @@ -96,7 +96,7 @@ public class RsaEncrypter extends AbstractJweEncrypter { String encMethod = jwe.getHeader().getEncryptionMethod(); //TODO: should also check for A128GCM and A256GCM, but Cipher.getInstance() does not support the GCM mode. For now, don't use them if(encMethod.equals("A128CBC") || encMethod.equals("A256CBC")) { - + // FIXME: this is fragile String delims = "[8,6]+"; String[] mode = encMethod.split(delims); diff --git a/openid-connect-common/src/test/java/org/mitre/jwe/encryption/impl/RsaEncrypterDecrypterTest.java b/openid-connect-common/src/test/java/org/mitre/jwe/encryption/impl/RsaEncrypterDecrypterTest.java index 919cf8620..9e03137af 100644 --- a/openid-connect-common/src/test/java/org/mitre/jwe/encryption/impl/RsaEncrypterDecrypterTest.java +++ b/openid-connect-common/src/test/java/org/mitre/jwe/encryption/impl/RsaEncrypterDecrypterTest.java @@ -59,7 +59,7 @@ public class RsaEncrypterDecrypterTest { Jwe jwe = new Jwe(new JweHeader(jweHeaderObject), null, jwePlaintextString.getBytes(), null); //generate key pair. this will be passed in from the user KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); - keyGen.initialize(4096); + keyGen.initialize(512); KeyPair pair = keyGen.generateKeyPair(); PublicKey publicKey = pair.getPublic(); PrivateKey privateKey = pair.getPrivate();