Examples of AlgorithmElement


Examples of org.odftoolkit.odfdom.pkg.manifest.AlgorithmElement

      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();
View Full Code Here

Examples of org.odftoolkit.odfdom.pkg.manifest.AlgorithmElement

 
  private byte[] decryptData(byte[] data, OdfFileEntry manifestEntry, EncryptionDataElement encryptionDataElement) {
    byte[] decompressData = null;
    try {
      KeyDerivationElement keyDerivationElement = OdfElement.findFirstChildNode(KeyDerivationElement.class, encryptionDataElement);
      AlgorithmElement algorithmElement = OdfElement.findFirstChildNode(AlgorithmElement.class, encryptionDataElement);
      String saltStr = keyDerivationElement.getSaltAttribute();
      String ivStr = algorithmElement.getInitialisationVectorAttribute();
      String checksum = encryptionDataElement.getChecksumAttribute();
      byte[] salt = Base64Binary.valueOf(saltStr).getBytes();
      byte[] iv = Base64Binary.valueOf(ivStr).getBytes();
      byte[] passBytes = oldPwd.getBytes("UTF-8");
      MessageDigest md = MessageDigest.getInstance("SHA-1");
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.