Examples of Base64Binary


Examples of org.odftoolkit.odfdom.type.Base64Binary

      IvParameterSpec ivParameterSpec = new IvParameterSpec(iv);
      cipher.init(Cipher.ENCRYPT_MODE, key, ivParameterSpec);
      encryptedData = cipher.doFinal(compressedData, 0, compressedDataLength);
     
      // 9.update file entry encryption data.
      String checksum = new Base64Binary(checksumBytes).toString();
      FileEntryElement fileEntryElement = fileEntry.getOdfElement();
      EncryptionDataElement encryptionDataElement = OdfElement.findFirstChildNode(EncryptionDataElement.class, fileEntryElement);
      if (encryptionDataElement != null) {
        fileEntryElement.removeChild(encryptionDataElement);
      }
      encryptionDataElement = fileEntryElement.newEncryptionDataElement(checksum, "SHA1/1K");
      String initialisationVector = new Base64Binary(iv).toString();
      AlgorithmElement algorithmElement = OdfElement.findFirstChildNode(AlgorithmElement.class, encryptionDataElement);
      if (algorithmElement != null) {
        encryptionDataElement.removeChild(algorithmElement);
      }
      algorithmElement = encryptionDataElement.newAlgorithmElement("Blowfish CFB", initialisationVector);
      String saltStr = new Base64Binary(salt).toString();
      KeyDerivationElement keyDerivationElement = OdfElement.findFirstChildNode(KeyDerivationElement.class, encryptionDataElement);
      if (keyDerivationElement != null) {
        encryptionDataElement.removeChild(keyDerivationElement);
      }
      keyDerivationElement = encryptionDataElement.newKeyDerivationElement(1024, "PBKDF2", saltStr);
View Full Code Here

Examples of org.odftoolkit.odfdom.type.Base64Binary

      // valid checksum
      md.reset();
      md.update(decryptedData, 0, (decryptedData.length > 1024 ? 1024 : decryptedData.length));
      byte[] checksumBytes = new byte[20];
      md.digest(checksumBytes, 0, 20);
      String newChecksum = new Base64Binary(checksumBytes).toString();
      if (newChecksum.equals(checksum)) {
        // decompress the bytes
        Inflater decompresser = new Inflater(true);
        decompresser.setInput(decryptedData);
        decompressData = new byte[manifestEntry.getSize()];
View Full Code Here

Examples of org.w3._2005._05.xmlmime.Base64Binary

    }
   
    private static final String text = "Binary Attachments are radical";
    private void setText(ImageDepot depot) {
       
        Base64Binary binary = new Base64Binary();
        binary.setContentType("");
        binary.setValue(text.getBytes());
        depot.setTextData(binary);
    }
View Full Code Here

Examples of org.w3._2005._05.xmlmime.Base64Binary

        binary.setValue(text.getBytes());
        depot.setTextData(binary);
    }
   
    private void checkText(ImageDepot depot) {
        Base64Binary binary = depot.getTextData();
        assertTrue(binary != null);
        String contentType = binary.getContentType();
        assertTrue("".equals(contentType));
        byte[] bytes = binary.getValue();
        assertTrue(bytes != null);
        String theText = new String(bytes);
        assertTrue(text.equals(theText));
    }
View Full Code Here

Examples of org.w3._2005._05.xmlmime.Base64Binary

    }
   
    private static final String text = "Binary Attachments are radical";
    private void setText(ImageDepot depot) {
       
        Base64Binary binary = new Base64Binary();
        binary.setContentType("");
        binary.setValue(text.getBytes());
        depot.setTextData(binary);
    }
View Full Code Here

Examples of org.w3._2005._05.xmlmime.Base64Binary

        binary.setValue(text.getBytes());
        depot.setTextData(binary);
    }
   
    private void checkText(ImageDepot depot) {
        Base64Binary binary = depot.getTextData();
        assertTrue(binary != null);
        String contentType = binary.getContentType();
        assertTrue("".equals(contentType));
        byte[] bytes = binary.getValue();
        assertTrue(bytes != null);
        String theText = new String(bytes);
        assertTrue(text.equals(theText));
    }
View Full Code Here

Examples of org.w3._2005._05.xmlmime.Base64Binary

    }
   
    private static final String text = "Binary Attachments are radical";
    private void setText(ImageDepot depot) {
       
        Base64Binary binary = new Base64Binary();
        binary.setContentType("");
        binary.setValue(text.getBytes());
        depot.setTextData(binary);
    }
View Full Code Here

Examples of org.w3._2005._05.xmlmime.Base64Binary

        binary.setValue(text.getBytes());
        depot.setTextData(binary);
    }
   
    private void checkText(ImageDepot depot) {
        Base64Binary binary = depot.getTextData();
        assertTrue(binary != null);
        String contentType = binary.getContentType();
        assertTrue("".equals(contentType));
        byte[] bytes = binary.getValue();
        assertTrue(bytes != null);
        String theText = new String(bytes);
        assertTrue(text.equals(theText));
    }
View Full Code Here

Examples of org.w3._2005._05.xmlmime.Base64Binary

    }
   
    private static final String text = "Binary Attachments are radical";
    private void setText(ImageDepot depot) {
       
        Base64Binary binary = new Base64Binary();
        binary.setContentType("");
        binary.setValue(text.getBytes());
        depot.setTextData(binary);
    }
View Full Code Here

Examples of org.w3._2005._05.xmlmime.Base64Binary

        binary.setValue(text.getBytes());
        depot.setTextData(binary);
    }
   
    private void checkText(ImageDepot depot) {
        Base64Binary binary = depot.getTextData();
        assertTrue(binary != null);
        String contentType = binary.getContentType();
        assertTrue("".equals(contentType));
        byte[] bytes = binary.getValue();
        assertTrue(bytes != null);
        String theText = new String(bytes);
        assertTrue(text.equals(theText));
    }
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.