Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void run()
- {
- while (true)
- {
- try
- {
- gniazdko=listener.accept();
- Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
- cipher.init(Cipher.DECRYPT_MODE,C.kluczPrywatny);
- //in = new ObjectInputStream(new CipherInputStream(gniazdko.getInputStream(),cipher));
- in = new ObjectInputStream((gniazdko.getInputStream()));
- //odp = (paczka)in.readObject();
- byte [] O = (byte[])in.readObject();
- ByteArrayOutputStream BAOS = new ByteArrayOutputStream();
- CipherOutputStream COS = new CipherOutputStream(BAOS, cipher);
- COS.write(O);
- byte [] B = BAOS.toByteArray();
- System.out.println("Coś przyszło");
- //System.out.println(odp.toString());
- System.out.println(new String(B));
- //System.out.println(C.deszyfruj(odp.szyfrowana));
- }
- catch (Exception e)
- {
- System.out.println(e.toString());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement