Examples of KeySelector


Examples of com.foundationdb.KeySelector

            byte[] key = packKey(storeData);
            storeData.iterator = new FDBStoreDataSingleKeyValueIterator(storeData,
              key, store.getTransaction(session, storeData).getFuture(key));
            return;
        }
        KeySelector ksLeft, ksRight;
        switch (left) {
        case START:
            ksLeft = KeySelector.firstGreaterOrEqual(prefixBytes(storeData));
            break;
        case KEY:
View Full Code Here

Examples of com.foundationdb.KeySelector

     * @param reverse Iterate in reverse.
     * @param snapshot Snapshot range scan
     */
    public void indexIterator(FDBStore store, Session session, FDBStoreData storeData,
                              boolean key, boolean inclusive, boolean reverse, boolean snapshot) {
        KeySelector ksLeft, ksRight;
        byte[] prefixBytes = prefixBytes(storeData);
        if (!key) {
            ksLeft = KeySelector.firstGreaterOrEqual(prefixBytes);
            ksRight = KeySelector.firstGreaterOrEqual(ByteArrayUtil.strinc(prefixBytes));
        }
View Full Code Here

Examples of javax.xml.crypto.KeySelector

    @org.junit.Test
    public void testsetngetKeySelector() throws Exception {
        defContext.setKeySelector(null);
        assertNull(defContext.getKeySelector());
        KeySelector ks = KeySelector.singletonKeySelector(KEYS[0]);
        defContext.setKeySelector(ks);
        assertEquals(defContext.getKeySelector(), ks);
    }
View Full Code Here

Examples of javax.xml.crypto.KeySelector

            fac = XMLSignatureFactory.getInstance("DOM", "ApacheXMLDSig");
        } catch (NoSuchProviderException ex) {
            fac = XMLSignatureFactory.getInstance("DOM");
        }

        KeySelector selector = getConfiguration().getKeySelector();
        if (selector == null) {
            throw new IllegalStateException("Wrong configuration. Key selector is missing.");
        }

        DOMValidateContext valContext = new DOMValidateContext(selector, doc);
View Full Code Here

Examples of javax.xml.crypto.KeySelector

                fac = XMLSignatureFactory.getInstance("DOM");
            }

            final Node node = getMessageBodyNode(out);

            final KeySelector keySelector = getConfiguration().getKeyAccessor().getKeySelector(out);
            if (keySelector == null) {
                throw new XmlSignatureNoKeyException(
                        "Key selector is missing for XML signature generation. Specify a key selector in the configuration.");
            }
View Full Code Here

Examples of javax.xml.crypto.KeySelector

    }

    public void test_signature_enveloping_hmac_sha1() throws Exception {
        String file = "signature-enveloping-hmac-sha1.xml";
       
  KeySelector ks = new KeySelectors.SecretKeySelector
      ("secret".getBytes("ASCII") );
  boolean coreValidity = validator.validate(file, ks);
  assertTrue("Signature failed core validation", coreValidity);
    }
View Full Code Here

Examples of javax.xml.crypto.KeySelector

    }

    public void test_signature_enveloping_hmac_sha1_40() throws Exception {
        String file = "signature-enveloping-hmac-sha1-40.xml";
       
  KeySelector ks = new KeySelectors.SecretKeySelector
      ("secret".getBytes("ASCII") );
        try {
      boolean coreValidity = validator.validate(file, ks);
            fail("Expected HMACOutputLength exception");
        } catch (XMLSignatureException xse) {
View Full Code Here

Examples of javax.xml.crypto.KeySelector

    }
    public void test_signature_hmac_sha1_40_c14n_comments_detached()
  throws Exception {
        String file = "signature-hmac-sha1-40-c14n-comments-detached.xml";
       
  KeySelector ks = new KeySelectors.SecretKeySelector
      ("test".getBytes("ASCII") );
        try {
      boolean coreValidity = validator.validate(file, ks);
            fail("Expected HMACOutputLength Exception");
        } catch (XMLSignatureException xse) {
View Full Code Here

Examples of javax.xml.crypto.KeySelector

    }
    public void test_signature_hmac_sha1_40_exclusive_c14n_comments_detached()
  throws Exception {
        String file = "signature-hmac-sha1-40-exclusive-c14n-comments-detached.xml";
       
  KeySelector ks = new KeySelectors.SecretKeySelector
      ("test".getBytes("ASCII") );
        try {
      boolean coreValidity = validator.validate(file, ks);
            fail("Expected HMACOutputLength Exception");
        } catch (XMLSignatureException xse) {
View Full Code Here

Examples of javax.xml.crypto.KeySelector

    }
    public void test_signature_hmac_sha1_exclusive_c14n_comments_detached()
  throws Exception {
        String file = "signature-hmac-sha1-exclusive-c14n-comments-detached.xml";
       
  KeySelector ks = new KeySelectors.SecretKeySelector
      ("test".getBytes("ASCII") );
  boolean coreValidity = validator.validate(file, ks);
  assertTrue("Signature failed core validation", coreValidity);
    }
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.