public BlowfishTupleSerializer(Kryo kryo, Map storm_conf) { String encryption_key = null; try { encryption_key = (String) storm_conf.get(SECRET_KEY); LOG.debug("Blowfish serializer being constructed ..."); if (encryption_key == null) { throw new RuntimeException("Blowfish encryption key not specified"); } byte[] bytes = Hex.decodeHex(encryption_key.toCharArray()); _serializer = new BlowfishSerializer(new ListDelegateSerializer(), bytes); } catch (org.apache.commons.codec.DecoderException ex) { throw new RuntimeException("Blowfish encryption key invalid", ex); } }
@Override public ListDelegate read(Kryo kryo, Input input, Class<ListDelegate> type) { return (ListDelegate) _serializer.read(kryo, input, type); }
@Override public void write(Kryo kryo, Output output, ListDelegate object) { _serializer.write(kryo, output, object); }
public Object read (Kryo kryo, Input input, Class type) { Cipher cipher = getCipher(Cipher.DECRYPT_MODE); CipherInputStream cipherInput = new CipherInputStream(input, cipher); return serializer.read(kryo, new Input(cipherInput, 256), type); }
public Object read (Kryo kryo, Input input, Class type) { Cipher cipher = getCipher(Cipher.DECRYPT_MODE); CipherInputStream cipherInput = new CipherInputStream(input, cipher); return serializer.read(kryo, new Input(cipherInput, 256), type); }
public Object read (Kryo kryo, Input input, Class type) { Cipher cipher = getCipher(Cipher.DECRYPT_MODE); CipherInputStream cipherInput = new CipherInputStream(input, cipher); return kryo.readObject(new Input(cipherInput, 256), type, serializer); }
public BlowfishTupleSerializer(Kryo kryo, Map<String, Object> topoConf) { String encryptionkey; try { encryptionkey = (String) topoConf.get(SECRET_KEY); LOG.debug("Blowfish serializer being constructed ..."); byte[] bytes; if (encryptionkey != null) { bytes = Hex.decodeHex(encryptionkey.toCharArray()); } else { // try to use zookeeper secret String payload = (String) topoConf.get(Config.STORM_ZOOKEEPER_TOPOLOGY_AUTH_PAYLOAD); if (payload != null) { LOG.debug("{} is not present. Use {} as Blowfish encryption key", SECRET_KEY, Config.STORM_ZOOKEEPER_TOPOLOGY_AUTH_PAYLOAD); bytes = payload.getBytes(); } else { throw new RuntimeException("Blowfish encryption key not specified"); } } serializer = new BlowfishSerializer(new ListDelegateSerializer(), bytes); } catch (DecoderException ex) { throw new RuntimeException("Blowfish encryption key invalid", ex); } }
@Override public void write(Kryo kryo, Output output, ListDelegate object) { _serializer.write(kryo, output, object); }
@Override public ListDelegate read(Kryo kryo, Input input, Class<ListDelegate> type) { return (ListDelegate)_serializer.read(kryo, input, type); }
public Object read (Kryo kryo, Input input, Class type) { Cipher cipher = getCipher(Cipher.DECRYPT_MODE); CipherInputStream cipherInput = new CipherInputStream(input, cipher); return serializer.read(kryo, new Input(cipherInput, 256), type); }
public BlowfishTupleSerializer(Kryo kryo, Map storm_conf) { String encryption_key = null; try { encryption_key = (String)storm_conf.get(SECRET_KEY); LOG.debug("Blowfish serializer being constructed ..."); if (encryption_key == null) { throw new RuntimeException("Blowfish encryption key not specified"); } byte[] bytes = Hex.decodeHex(encryption_key.toCharArray()); _serializer = new BlowfishSerializer(new ListDelegateSerializer(), bytes); } catch (org.apache.commons.codec.DecoderException ex) { throw new RuntimeException("Blowfish encryption key invalid", ex); } }
public void write (Kryo kryo, Output output, Object object) { Cipher cipher = getCipher(Cipher.ENCRYPT_MODE); CipherOutputStream cipherStream = new CipherOutputStream(output, cipher); Output cipherOutput = new Output(cipherStream, 256) { public void close () throws KryoException { // Don't allow the CipherOutputStream to close the output. } }; serializer.write(kryo, cipherOutput, object); cipherOutput.flush(); try { cipherStream.close(); } catch (IOException ex) { throw new KryoException(ex); } }
public BlowfishTupleSerializer(Kryo kryo, Map storm_conf) { String encryption_key; try { encryption_key = (String)storm_conf.get(SECRET_KEY); LOG.debug("Blowfish serializer being constructed ..."); if (encryption_key == null) { throw new RuntimeException("Blowfish encryption key not specified"); } byte[] bytes = Hex.decodeHex(encryption_key.toCharArray()); _serializer = new BlowfishSerializer(new ListDelegateSerializer(), bytes); } catch (org.apache.commons.codec.DecoderException ex) { throw new RuntimeException("Blowfish encryption key invalid", ex); } }
public void write (Kryo kryo, Output output, Object object) { Cipher cipher = getCipher(Cipher.ENCRYPT_MODE); CipherOutputStream cipherStream = new CipherOutputStream(output, cipher); Output cipherOutput = new Output(cipherStream, 256) { public void close () throws KryoException { // Don't allow the CipherOutputStream to close the output. } }; kryo.writeObject(cipherOutput, object, serializer); cipherOutput.flush(); try { cipherStream.close(); } catch (IOException ex) { throw new KryoException(ex); } }
public void write (Kryo kryo, Output output, Object object) { Cipher cipher = getCipher(Cipher.ENCRYPT_MODE); CipherOutputStream cipherStream = new CipherOutputStream(output, cipher); Output cipherOutput = new Output(cipherStream, 256) { public void close () throws KryoException { // Don't allow the CipherOutputStream to close the output. } }; serializer.write(kryo, cipherOutput, object); cipherOutput.flush(); try { cipherStream.close(); } catch (IOException ex) { throw new KryoException(ex); } }
public void write (Kryo kryo, Output output, Object object) { Cipher cipher = getCipher(Cipher.ENCRYPT_MODE); CipherOutputStream cipherStream = new CipherOutputStream(output, cipher); Output cipherOutput = new Output(cipherStream, 256) { public void close () throws KryoException { // Don't allow the CipherOutputStream to close the output. } }; serializer.write(kryo, cipherOutput, object); cipherOutput.flush(); try { cipherStream.close(); } catch (IOException ex) { throw new KryoException(ex); } }