Examples of BasicBlobCrypter


Examples of org.apache.shindig.common.crypto.BasicBlobCrypter

        this.userService = userService;
        this.container = container;
        this.domain = domain;

        if (encryptionKey.startsWith(EMBEDDED_KEY_PREFIX)) {
            this.blobCrypter = new BasicBlobCrypter(encryptionKey.substring(EMBEDDED_KEY_PREFIX.length()));
        } else if (encryptionKey.startsWith(CLASSPATH_KEY_PREFIX)) {
            try {
                File file = new ClassPathResource(encryptionKey.substring(CLASSPATH_KEY_PREFIX.length())).getFile();
                this.blobCrypter = new BasicBlobCrypter(FileUtils.readFileToString(file, "UTF-8"));
            } catch (IOException e) {
                throw new SecurityException("Unable to load encryption key from classpath resource: " + encryptionKey);
            }
        } else {
            try {
                File file = new File(encryptionKey);
                this.blobCrypter = new BasicBlobCrypter(FileUtils.readFileToString(file, "UTF-8"));
            } catch (IOException e) {
                throw new SecurityException("Unable to load encryption key from file: " + encryptionKey);
            }
        }
    }
View Full Code Here

Examples of org.apache.shindig.common.crypto.BasicBlobCrypter

    privateToken = new FakeGadgetToken();
    privateToken.setOwnerId("owner");
    privateToken.setViewerId("owner");
    privateToken.setAppUrl(GADGET_URL);

    stateCrypter = new BasicBlobCrypter("abcdefghijklmnop".getBytes());
    clientState = new OAuthClientState(stateCrypter);
    responseParams = new OAuthResponseParams(socialToken, null, stateCrypter);
  }
View Full Code Here

Examples of org.apache.shindig.common.crypto.BasicBlobCrypter

    base = new BasicOAuthStore();
    base.setDefaultCallbackUrl(GadgetTokenStoreTest.DEFAULT_CALLBACK);
    serviceProvider = new FakeOAuthServiceProvider(clock);
    callbackGenerator = createNullCallbackGenerator();
    fetcherConfig = new OAuthFetcherConfig(
        new BasicBlobCrypter("abcdefghijklmnop".getBytes()),
        getOAuthStore(base),
        clock,
        callbackGenerator,
        false);
View Full Code Here

Examples of org.apache.shindig.common.crypto.BasicBlobCrypter

  }

  @Test
  public void testOAuthFlow_withCallbackVerifier() throws Exception {
    fetcherConfig = new OAuthFetcherConfig(
        new BasicBlobCrypter("abcdefghijklmnop".getBytes()),
        getOAuthStore(base),
        clock,
        createRealCallbackGenerator(),
        false);
    MakeRequestClient client = makeNonSocialClient("owner", "owner", GADGET_URL);
View Full Code Here

Examples of org.apache.shindig.common.crypto.BasicBlobCrypter

  }

  @Test
  public void testOAuthFlow_badCallbackVerifier() throws Exception {
    fetcherConfig = new OAuthFetcherConfig(
        new BasicBlobCrypter("abcdefghijklmnop".getBytes()),
        getOAuthStore(base),
        clock,
        createRealCallbackGenerator(),
        false);
    MakeRequestClient client = makeNonSocialClient("owner", "owner", GADGET_URL);
View Full Code Here

Examples of org.apache.shindig.common.crypto.BasicBlobCrypter

  @Test
  public void testOAuthFlow_noViewer() throws Exception {
    for (boolean secureOwner : Arrays.asList(true, false)) {
      // Test both with/without secure owner pages
      fetcherConfig = new OAuthFetcherConfig(
        new BasicBlobCrypter("abcdefghijklmnop".getBytes()),
        getOAuthStore(base),
        clock, callbackGenerator,
        secureOwner);

      MakeRequestClient client = makeNonSocialClient("owner", null, GADGET_URL);
View Full Code Here

Examples of org.apache.shindig.common.crypto.BasicBlobCrypter

  }

  @Test
  public void testOAuthFlow_noSpec() throws Exception {
    fetcherConfig = new OAuthFetcherConfig(
        new BasicBlobCrypter("abcdefghijklmnop".getBytes()),
        getOAuthStore(base, null),
        clock, callbackGenerator,
        false);

    MakeRequestClient client = makeNonSocialClient("owner", "owner", GADGET_URL);
View Full Code Here

Examples of org.apache.shindig.common.crypto.BasicBlobCrypter

  }

  @Test
  public void testOAuthFlow_noSpecNoRequestTokenUrl() throws Exception {
    fetcherConfig = new OAuthFetcherConfig(
        new BasicBlobCrypter("abcdefghijklmnop".getBytes()),
        getOAuthStore(base, null),
        clock, null, false);

    MakeRequestClient client = makeNonSocialClient("owner", "owner", GADGET_URL);
    setNoSpecOptions(client);
View Full Code Here

Examples of org.apache.shindig.common.crypto.BasicBlobCrypter

  }

  @Test
  public void testOAuthFlow_noSpecNoAccessTokenUrl() throws Exception {
    fetcherConfig = new OAuthFetcherConfig(
        new BasicBlobCrypter("abcdefghijklmnop".getBytes()),
        getOAuthStore(base, null),
        clock, callbackGenerator, false);

    MakeRequestClient client = makeNonSocialClient("owner", "owner", GADGET_URL);
    setNoSpecOptions(client);
View Full Code Here

Examples of org.apache.shindig.common.crypto.BasicBlobCrypter

  }

  @Test
  public void testOAuthFlow_noSpecNoApprovalUrl() throws Exception {
    fetcherConfig = new OAuthFetcherConfig(
        new BasicBlobCrypter("abcdefghijklmnop".getBytes()),
        getOAuthStore(base, null),
        clock, callbackGenerator, false);

    MakeRequestClient client = makeNonSocialClient("owner", "owner", GADGET_URL);
    setNoSpecOptions(client);
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.