Package org.odftoolkit.odfdom.pkg.manifest

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


      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);
      StartKeyGenerationElement startKeyGenerationElement = OdfElement.findFirstChildNode(StartKeyGenerationElement.class, encryptionDataElement);
View Full Code Here


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

TOP

Related Classes of org.odftoolkit.odfdom.pkg.manifest.KeyDerivationElement

Copyright © 2018 www.massapicom. 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.