Search in sources :

Example 16 with EncryptedEmailPacket

use of i2p.bote.packet.dht.EncryptedEmailPacket in project i2p.i2p-bote by i2p.

the class ResponsePacketTest method createDataPacket.

private DataPacket createDataPacket() throws GeneralSecurityException, IOException {
    byte[] dataToStore = new byte[] { 2, 109, -80, -37, -106, 83, -33, -39, -94, -76, -112, -98, 99, 25, -61, 44, -92, -85, 1, 10, -128, -2, -27, -86, -126, -33, -11, 42, 56, 3, -97, -101, 111, 7, -96, 25, 121, 74, 89, -40, -33, 82, -50, -18, 49, 106, 13, -121, 53, -83, -2, 35, -7, 71, -71, 26, 90, 1 };
    byte[] messageIdBytes = new byte[] { -69, -24, -109, 1, 69, -122, -69, 113, -68, -90, 55, -28, 105, 97, 125, 70, 51, 58, 14, 2, -13, -53, 90, -29, 36, 67, 36, -94, -108, -125, 11, 123 };
    UniqueId messageId = new UniqueId(messageIdBytes, 0);
    int fragmentIndex = 0;
    UnencryptedEmailPacket unencryptedPacket = new UnencryptedEmailPacket(new ByteArrayInputStream(dataToStore), messageId, fragmentIndex, I2PBotePacket.MAX_DATAGRAM_SIZE);
    unencryptedPacket.setNumFragments(1);
    EmailDestination destination = new EmailDestination("0XuJjhgp58aOhvHHgpaxoQYsCUfDS6BECMEoVxFGEFPdk3y8lbzIsq9eUyeizFleMacYwoscCir8nQLlW34lxfRmirkNpD9vU1XnmjnZ5hGdnor1qIDqz3KJ040dVQ617MwyG97xxYLT0FsH907vBXgdc4RCHwKd1~9siagA5CSMaA~wM8ymKXLypiZGYexENLmim7nMzJTQYoOM~fVS99UaGJleDBN3pgZ2EvRYDQV2VqKH7Gee07R3y7b~c0tAKVHS0IbPQfTVJigrIHjTl~ZczxpaeTM04T8IgxKnO~lSmR1w7Ik8TpEkETwT9PDwUqQsjmlSY8E~WwwGMRJVyIRZUkHeRZ0aFq7us8W9EKzYtjjiU1z0QFpZrTfJE8oqCbnH5Lqv5Q86UdTPpriJC1N99E77TpCTnNzcBnpp6ko2JCy2IJUveaigKxS6EmS9KarkkkBRsckOKZZ6UNTOqPZsBCsx0Q9WvDF-Uc3dtouXWyenxRptaQsdkZyYlEQv");
    return new EncryptedEmailPacket(unencryptedPacket, destination);
}
Also used : UniqueId(i2p.bote.UniqueId) ByteArrayInputStream(java.io.ByteArrayInputStream) EncryptedEmailPacket(i2p.bote.packet.dht.EncryptedEmailPacket) EmailDestination(i2p.bote.email.EmailDestination) UnencryptedEmailPacket(i2p.bote.packet.dht.UnencryptedEmailPacket)

Aggregations

EncryptedEmailPacket (i2p.bote.packet.dht.EncryptedEmailPacket)16 UniqueId (i2p.bote.UniqueId)7 UnencryptedEmailPacket (i2p.bote.packet.dht.UnencryptedEmailPacket)6 Test (org.junit.Test)6 EmailDestination (i2p.bote.email.EmailDestination)5 ByteArrayInputStream (java.io.ByteArrayInputStream)5 File (java.io.File)5 DhtStorablePacket (i2p.bote.packet.dht.DhtStorablePacket)4 IndexPacket (i2p.bote.packet.dht.IndexPacket)4 DeleteRequest (i2p.bote.packet.dht.DeleteRequest)3 DeletionInfoPacket (i2p.bote.packet.dht.DeletionInfoPacket)3 DeletionRecord (i2p.bote.packet.dht.DeletionRecord)3 EmailPacketDeleteRequest (i2p.bote.packet.dht.EmailPacketDeleteRequest)3 Hash (net.i2p.data.Hash)3 Before (org.junit.Before)3 Email (i2p.bote.email.Email)2 EmailIdentity (i2p.bote.email.EmailIdentity)2 DataPacket (i2p.bote.packet.DataPacket)2 InternetAddress (javax.mail.internet.InternetAddress)2 Destination (net.i2p.data.Destination)2