Package org.apache.abdera.security

Examples of org.apache.abdera.security.Signature.sign()


    SignatureOptions options = sig.getDefaultSignatureOptions();   
    options.setCertificate(cert);
    options.setSigningKey(signingKey)

    // Sign the entry
    entry = sig.sign(entry, options);
    assertNotNull(
      entry.getFirstChild(
        new QName(
          "http://www.w3.org/2000/09/xmldsig#",
          "Signature")));
View Full Code Here


    SignatureOptions options = sig.getDefaultSignatureOptions();   
    options.setCertificate(cert);
    options.setSigningKey(signingKey);

    // Sign the entry
    entry = sig.sign(entry, options);
    assertNotNull(
      entry.getFirstChild(
        new QName(
          "http://www.w3.org/2000/09/xmldsig#",
          "Signature")));
View Full Code Here

    Signature sig = security.getSignature();
    SignatureOptions options = sig.getDefaultSignatureOptions();   
    options.setCertificate(cert);
    options.setSigningKey(signingKey);
    Element element = doc.getRoot();
    element = sig.sign(element, options);
    return element.getDocument();
  }
 
  private Document<Element> getDocument(BufferingResponseWrapper wrapper) {
    Reader rdr = wrapper.getReader();
View Full Code Here

    SignatureOptions options = sig.getDefaultSignatureOptions();   
    options.setCertificate(cert);
    options.setSigningKey(signingKey)

    // Sign the entry
    entry = sig.sign(entry, options);     
   
    // Check the round trip
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    entry.writeTo(out); // do not use the pretty writer, it will break the signature
    ByteArrayInputStream bais = new ByteArrayInputStream(out.toByteArray());
View Full Code Here

    SignatureOptions options = sig.getDefaultSignatureOptions();   
    options.setCertificate(cert);
    options.setSigningKey(signingKey)

    // Sign the entry
    entry = sig.sign(entry, options);     
   
    // Check the round trip
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    entry.writeTo(out); // do not use the pretty writer, it will break the signature
    ByteArrayInputStream bais = new ByteArrayInputStream(out.toByteArray());
View Full Code Here

    options.setCertificate(cert);
    options.setSigningKey(signingKey);
    if (algorithm != null)
      options.setSigningAlgorithm(algorithm);
    Element element = doc.getRoot();
    element = sig.sign(element, options);
    return element.getDocument();
  }

  private class SigningResponseContextWrapper
    extends ResponseContextWrapper {
View Full Code Here

        SignatureOptions options = sig.getDefaultSignatureOptions();
        options.setCertificate(cert);
        options.setSigningKey(signingKey);

        // Sign the entry
        entry = sig.sign(entry, options);
        assertNotNull(entry.getFirstChild(new QName("http://www.w3.org/2000/09/xmldsig#", "Signature")));

        X509Certificate[] certs = sig.getValidSignatureCertificates(entry, options);
        assertNotNull(certs);
        assertEquals(1, certs.length);
View Full Code Here

        SignatureOptions options = sig.getDefaultSignatureOptions();
        options.setCertificate(cert);
        options.setSigningKey(signingKey);

        // Sign the entry
        entry = sig.sign(entry, options);

        resp = client.post("http://localhost:9002/feed", entry);
        assertNotNull(resp);
        assertEquals(ResponseType.SUCCESS, resp.getType());
    }
View Full Code Here

        SignatureOptions options = sig.getDefaultSignatureOptions();
        options.setCertificate(cert);
        options.setSigningKey(signingKey);

        // Sign the entry
        entry = sig.sign(entry, options);

        // Check the round trip
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        entry.writeTo(out); // do not use the pretty writer, it will break the signature
        ByteArrayInputStream bais = new ByteArrayInputStream(out.toByteArray());
View Full Code Here

        options.setCertificate(cert);
        options.setSigningKey(signingKey);
        if (algorithm != null)
            options.setSigningAlgorithm(algorithm);
        Element element = doc.getRoot();
        element = sig.sign(element, options);
        return element.getDocument();
    }

    private class SigningResponseContextWrapper extends ResponseContextWrapper {
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.