Package org.apache.shindig.common.crypto

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


    String domain = domains.get(container);
    String activeUrl = tokenParameters.get(SecurityTokenCodec.ACTIVE_URL_NAME);
    String crypted = fields[1];
    try {
      BlobCrypterSecurityToken st = new BlobCrypterSecurityToken(container, domain, activeUrl,
          crypter.unwrap(crypted));
      return st.enforceNotExpired();
    } catch (BlobCrypterException e) {
      throw new SecurityTokenException(e);
    }
  }
View Full Code Here


    String domain = domains.get(container);
    String activeUrl = tokenParameters.get(SecurityTokenCodec.ACTIVE_URL_NAME);
    String crypted = fields[1];
    try {
      BlobCrypterSecurityToken st = new BlobCrypterSecurityToken(container, domain, activeUrl,
          crypter.unwrap(crypted));
      return st.enforceNotExpired();
    } catch (BlobCrypterException e) {
      throw new SecurityTokenException(e);
    }
  }
View Full Code Here

    String domain = domains.get(container);
    String activeUrl = tokenParameters.get(SecurityTokenCodec.ACTIVE_URL_NAME);
    String crypted = fields[1];
    try {
      BlobCrypterSecurityToken st = new BlobCrypterSecurityToken(container, domain, activeUrl,
          crypter.unwrap(crypted));
      return st.enforceNotExpired();
    } catch (BlobCrypterException e) {
      throw new SecurityTokenException(e);
    }
  }
View Full Code Here

    String domain = domains.get(container);
    String activeUrl = tokenParameters.get(SecurityTokenCodec.ACTIVE_URL_NAME);
    String crypted = fields[1];
    try {
      BlobCrypterSecurityToken st = new BlobCrypterSecurityToken(container, domain, activeUrl,
          crypter.unwrap(crypted));
      return st.enforceNotExpired();
    } catch (BlobCrypterException e) {
      throw new SecurityTokenException(e);
    }
  }
View Full Code Here

  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.