Hallo!

Ich habe ein kleines Problem mit der unten geposteten Methode.
Wird diese in Eclipse im Remote Debug Modus unter localhost aufgerufen, blockt die Methode 1-2 Minuten bei getObject.

Allgemein blocken auch Methoden wie Cipher.getInstance und Cipher.init ziemlich lange.

Code java:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
    /**
     * Decrypts a {@link SealedObject} encrypted by the method {@link #cryptObject(Object, String)}.
     * 
     * @param so The SealedObject to decrypt.
     * @param key The key to use for decryption. Should be the same as the one used to encrypt the object.
     * @return The decrypted, deserialized object or null if there was another problem than an invalid key.
     * @throws InvalidKeyException If the given key was not correct.
     */
    public static Object decryptObject(SealedObject so, String key) throws InvalidKeyException{
        SecretKey seckey = new SecretKeySpec(key.getBytes(), "Blowfish");
        Object o = null;
        try{
            o = so.getObject(seckey); //Bad performance here during debugging. why?
        }
        catch(NoSuchAlgorithmException e){
            return null;
        }
        catch(IOException e){
            return null;
        }
        catch(ClassNotFoundException e){
            return null;
        }
 
        return o;
    }

Weiß jemand vielleicht warum?

Denn bei normaler Ausführung gibt es keine Probleme...

mfg
Martin