Пример #1
0
 public void testUnwrap() throws Exception {
   crypt = new JCECrypter(null, null, bobname, bobpwd.toCharArray());
   SAT sat = new SAT(crypt);
   Map<String, Serializable> res = sat.unwrap(encrypted, true);
   assertNull(res.get("error"));
   String val = (String) res.get("test");
   assertEquals(val, "Ein Testtext");
   assertEquals(alicename, res.get(SAT.ADM_SIGNED_BY));
 }
Пример #2
0
 public void testWrap() throws Exception {
   crypt = new JCECrypter(null, null, alicename, alicepwd.toCharArray());
   SAT sat = new SAT(crypt);
   HashMap<String, Serializable> hash = new HashMap<String, Serializable>();
   hash.put("test", "Ein Testtext");
   byte[] result = sat.wrap(hash, bobname);
   assertNotNull(result);
   System.out.println(new String(result));
   encrypted = result;
 }