Examples of SignatureOptions


Examples of org.apache.abdera.security.SignatureOptions

        return push(feed, serving);
    }

    private final static SignatureOptions getSignatureOptions(Signature signer,
            KeyPair signingKeys) throws SecurityException {
        SignatureOptions options = signer.getDefaultSignatureOptions();
        options.setSigningAlgorithm("http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1");
        options.setSignLinks(false); // don't sign atom:links
        options.setPublicKey(signingKeys.getPublic());
        options.setSigningKey(signingKeys.getPrivate());
        return options;
    }
View Full Code Here

Examples of org.apache.abdera.security.SignatureOptions

        }

        // prep the verifier
        AbderaSecurity security = new AbderaSecurity(Abdera.getInstance());
        Signature signature = security.getSignature();
        SignatureOptions options = signature.getDefaultSignatureOptions();
        options.setSigningAlgorithm("http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1");
        options.setSignLinks(false);
        options.setPublicKey(publicKey);

        // validate, persist, and remove each entry
        List<Entry> entries = new LinkedList<Entry>();
        entries.addAll(feed.getEntries()); // make a copy
        String existingEntryXml;
View Full Code Here

Examples of org.apache.abdera.security.SignatureOptions

    entry.addAuthor("James");
    entry.addLink("http://www.example.org");
   
    // Prepare the digital signature options
    Signature sig = absec.getSignature();
    SignatureOptions options = sig.getDefaultSignatureOptions();   
    options.setCertificate(cert);
    options.setSigningKey(signingKey)

    // Sign the entry
    entry = sig.sign(entry, options);
    assertNotNull(
      entry.getFirstChild(
View Full Code Here

Examples of org.apache.abdera.security.SignatureOptions

        certificateAlias);
    assertNotNull(signingKey);
    assertNotNull(cert);

    Signature sig = security.getSignature();
    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);
View Full Code Here

Examples of org.apache.abdera.security.SignatureOptions

  }

  private Document<Element> sign(Document<Element> doc) throws SecurityException  {
    if (signingKey == null || cert == null) return doc; // pass through
    Signature sig = security.getSignature();
    SignatureOptions options = sig.getDefaultSignatureOptions();
    options.setCertificate(cert);
    options.setSigningKey(signingKey);
    options.setSigningAlgorithm(algorithm);
    Element element = doc.getRoot();
    element = sig.sign(element, options);
    return element.getDocument();
  }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions

        if (signatureProperties != null && signatureProperties.isVisualSignEnabled())
        {
            try
            {
                options = new SignatureOptions();
                options.setVisualSignature(signatureProperties);
                // options.setPage(signatureProperties.getPage());
                // options.setPreferedSignatureSize(signatureProperties.getPreferredSize());
                doc.addSignature(signature, this, options);
            }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions

     * @param signatureInterface is a interface which provides signing capabilities
     * @throws IOException if there is an error creating required fields
     */
    public void addSignature(PDSignature sigObject, SignatureInterface signatureInterface) throws IOException
    {
        addSignature(sigObject, signatureInterface, new SignatureOptions());
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions

     * @throws SignatureException if something went wrong
     */
    public void addSignature(PDSignature sigObject, SignatureInterface signatureInterface)
            throws IOException, SignatureException
    {
        SignatureOptions defaultOptions = new SignatureOptions();
        defaultOptions.setPage(1);
        addSignature(sigObject, signatureInterface,defaultOptions);
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions

    signature.setSignDate(Calendar.getInstance());

    // register signature dictionary and sign interface

    if (signatureProperties != null && signatureProperties.isVisualSignEnabled()) {
      options = new SignatureOptions();
      options.setVisualSignature(signatureProperties);
      // options.setPage(signatureProperties.getPage());
      // options.setPreferedSignatureSize(signatureProperties.getPreferredSize());
      doc.addSignature(signature, this, options);
    } else {
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions

     * @throws SignatureException if something went wrong
     */
    public void addSignature(PDSignature sigObject, SignatureInterface signatureInterface)
            throws IOException, SignatureException
    {
        SignatureOptions defaultOptions = new SignatureOptions();
        defaultOptions.setPage(1);
        addSignature(sigObject, signatureInterface,defaultOptions);
    }
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.