Package org.apache.shindig.common.crypto

Examples of org.apache.shindig.common.crypto.BasicBlobCrypter.unwrap()


  public void testFixedKey() throws Exception {
    BlobCrypter alt = new BasicBlobCrypter("0123456789abcdef".getBytes());
    Map<String, String> in = ImmutableMap.of("a","b");

    String blob = crypter.wrap(in);
    Map<String, String> out = alt.unwrap(blob, 30);
    assertEquals("b", out.get("a"));
  }

  @Test
  public void testBadKey() throws Exception {
View Full Code Here


    BlobCrypter alt = new BasicBlobCrypter("1123456789abcdef".getBytes());
    Map<String, String> in = ImmutableMap.of("a","b");

    String blob = crypter.wrap(in);
    try {
      alt.unwrap(blob, 30);
      fail("Decryption should have failed");
    } catch (BlobCrypterException e) {
      // Good.
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.