Package org.apache.abdera.security

Examples of org.apache.abdera.security.Encryption.encrypt()


    Encryption enc = absec.getEncryption();
    EncryptionOptions options = enc.getDefaultEncryptionOptions();
    options.setDataEncryptionKey(key);
   
    // Encrypt the document using the generated key
    Document enc_doc = enc.encrypt(entry.getDocument(), options);
   
    assertEquals(
      enc_doc.getRoot().getQName(),
      new QName(
        "http://www.w3.org/2001/04/xmlenc#",
View Full Code Here


        chain.doFilter(request, wrapper);
        Document<Element> doc = getDocument(wrapper);
        if (doc != null) { 
          Encryption enc = security.getEncryption();
          EncryptionOptions options = context.getEncryptionOptions(enc);
          Document<Element> enc_doc = enc.encrypt(doc, options);
          returnPublicKey((HttpServletResponse)response,context);
          enc_doc.writeTo(response.getOutputStream());
        }
      } else {
        chain.doFilter(request, response);
View Full Code Here

          EncryptionOptions options = enc.getDefaultEncryptionOptions();
          options.setDataEncryptionKey(key);
          options.setKeyEncryptionKey(pkey);
          options.setKeyCipherAlgorithm(XMLCipher.RSA_v1dot5);
          options.setIncludeKeyInfo(true);
          Document<Element> enc_doc = enc.encrypt(doc, options);
          enc_doc.writeTo(response.getOutputStream());
        }
      } else {
        chain.doFilter(request, response);
      }
View Full Code Here

    Encryption enc = absec.getEncryption();
    EncryptionOptions options = enc.getDefaultEncryptionOptions();
    options.setDataEncryptionKey(key);
   
    // Encrypt the document using the generated key
    Document enc_doc = enc.encrypt(entry.getDocument(), options);

    enc_doc.writeTo(System.out);
   
    System.out.println("\n\n");
   
View Full Code Here

    // Prepare the encryption options
    Encryption enc = absec.getEncryption();
   
    // Encrypt the document using A's DHContext
    EncryptionOptions options = context_a.getEncryptionOptions(enc);
    Document enc_doc = enc.encrypt(entry.getDocument(), options);

    enc_doc.writeTo(System.out);
   
    System.out.println("\n\n");
   
View Full Code Here

    Encryption enc = absec.getEncryption();
    EncryptionOptions options = enc.getDefaultEncryptionOptions();
    options.setDataEncryptionKey(key);
   
    // Encrypt the document using the generated key
    Document enc_doc = enc.encrypt(entry.getDocument(), options);

    enc_doc.writeTo(System.out);
   
    System.out.println("\n\n");
   
View Full Code Here

        doc = abdera.getParser().parse(in);
      } catch (Exception e) {}
      if (doc != null) { 
        Encryption enc = security.getEncryption();
        EncryptionOptions options = initEncryptionOptions(request,response,enc,arg);
        doc = enc.encrypt(doc, options);
      }
      if (doc != null)
        doc.writeTo(aout);
      else
        throw new RuntimeException(
View Full Code Here

        Encryption enc = absec.getEncryption();
        EncryptionOptions options = enc.getDefaultEncryptionOptions();
        options.setDataEncryptionKey(key);

        // Encrypt the document using the generated key
        Document enc_doc = enc.encrypt(entry.getDocument(), options);

        assertEquals(new QName("http://www.w3.org/2001/04/xmlenc#", "EncryptedData"), enc_doc.getRoot().getQName());

        // Decrypt the document using the generated key
        Document<Entry> entry_doc = enc.decrypt(enc_doc, options);
View Full Code Here

        Encryption enc = absec.getEncryption();
        EncryptionOptions options = enc.getDefaultEncryptionOptions();
        options.setDataEncryptionKey(key);

        // Encrypt the document using the generated key
        Document enc_doc = enc.encrypt(entry.getDocument(), options);

        enc_doc.writeTo(System.out);

        System.out.println("\n\n");
View Full Code Here

        // Prepare the encryption options
        Encryption enc = absec.getEncryption();

        // Encrypt the document using A's DHContext
        EncryptionOptions options = context_a.getEncryptionOptions(enc);
        Document enc_doc = enc.encrypt(entry.getDocument(), options);

        enc_doc.writeTo(System.out);

        System.out.println("\n\n");
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.