Examples of martial()


Examples of org.apache.xml.security.encryption.XMLCipher.martial()

        if (encryptedKeys == null) {
            encryptedKeys = new ArrayList<EncryptedKey>();
        }
        encryptedKeys.add(encryptedKey);
        XMLCipher cipher = XMLCipher.getInstance();
        this.constructionElement.appendChild(cipher.martial(encryptedKey));
    }

    /**
     * Method addUnknownElement
     *
 
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

        //decrypt
        XMLCipher dcipher = XMLCipher.getInstance(XMLCipher.AES_128);
        dcipher.init(XMLCipher.DECRYPT_MODE, key);
        String algorithm = encryptedData.getEncryptionMethod().getAlgorithm();
        assert(XMLCipher.AES_128.equals(algorithm));
        byte[] bytes = dcipher.decryptToByteArray(dcipher.martial(encryptedData));
        String after = new String(bytes, "UTF-8");
        assert before.equals(after);

        // test with null type
        encryptedData = cipher.encryptData(d, null, new ByteArrayInputStream(serialized));
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

    throws XMLEncryptionException {
      if (encryptedKeys==null)
        encryptedKeys=new ArrayList();
      encryptedKeys.add(encryptedKey);
      XMLCipher cipher = XMLCipher.getInstance();
      this._constructionElement.appendChild(cipher.martial(encryptedKey));
  }

   /**
    * Method addUnknownElement
    *
 
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

        if (encryptedKeys == null) {
            encryptedKeys = new ArrayList<EncryptedKey>();
        }
        encryptedKeys.add(encryptedKey);
        XMLCipher cipher = XMLCipher.getInstance();
        appendSelf(cipher.martial(encryptedKey));
    }
   
    /**
     * Method addDEREncodedKeyValue
     *
 
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

      {
         throw new ProcessingException(e);
      }
     
      // The EncryptedKey element is added
      Element encryptedKeyElement =  cipher.martial(document, encryptedKey);

      String wrappingElementName = wrappingElementPrefix + ":" + wrappingElementQName.getLocalPart();
     
      //Create the wrapping element and set its attribute NS
      Element wrappingElement = encryptedDoc.createElementNS(wrappingElementQName.getNamespaceURI(),
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

      {
         throw new ProcessingException(e);
      }
     
      // The EncryptedKey element is added
      Element encryptedKeyElement =  cipher.martial(document, encryptedKey);

      String wrappingElementName = wrappingElementPrefix + ":" + wrappingElementQName.getLocalPart();
     
      //Create the wrapping element and set its attribute NS
      Element wrappingElement = encryptedDoc.createElementNS(wrappingElementQName.getNamespaceURI(),
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

  public void add(EncryptedKey encryptedKey)
    throws XMLEncryptionException {

    if (this._state == MODE_SIGN) {
      XMLCipher cipher = XMLCipher.getInstance();
      this._constructionElement.appendChild(cipher.martial(encryptedKey));
    }

  }

   /**
 
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

      key.setKeyInfo(keyInfo);

      key.setReferenceList(cipher.createReferenceList(org.apache.xml.security.encryption.ReferenceList.DATA_REFERENCE));
      list.populateRealReferenceList(key.getReferenceList());

      cachedElement = cipher.martial(key);
      return cachedElement;
   }

   public void addReference(String id)
   {
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

        //decrypt
        XMLCipher dcipher = XMLCipher.getInstance(XMLCipher.AES_128);
        dcipher.init(XMLCipher.DECRYPT_MODE, key);
        String algorithm = encryptedData.getEncryptionMethod().getAlgorithm();
        assertEquals(XMLCipher.AES_128, algorithm);
        byte[] bytes = dcipher.decryptToByteArray(dcipher.martial(encryptedData));
        String after = new String(bytes, "UTF-8");
        assertEquals(before, after);

        // test with null type
        encryptedData = cipher.encryptData(d, null, new ByteArrayInputStream(serialized));
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

       
        assertEquals("#id10", keyRef10.getURI());

        // See SANTUARIO-302
        // https://issues.apache.org/jira/browse/SANTUARIO-302
        Element dataRefListElement = dataCipher.martial(doc, dataRefList);
        assertEquals(EncryptionConstants.EncryptionSpecNS, dataRefListElement.getNamespaceURI());
        assertEquals(EncryptionConstants._TAG_REFERENCELIST, dataRefListElement.getLocalName());
        Element dataRef1Element = (Element)dataRefListElement.getFirstChild();
        assertEquals(EncryptionConstants.EncryptionSpecNS, dataRef1Element.getNamespaceURI());
        assertEquals(EncryptionConstants._TAG_DATAREFERENCE, dataRef1Element.getLocalName());
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.