Examples of Biff8EncryptionKey


Examples of org.apache.poi.hssf.record.crypto.Biff8EncryptionKey

    public RecordInputStream createDecryptingStream(InputStream original) {
      FilePassRecord fpr = _filePassRec;
      String userPassword = Biff8EncryptionKey.getCurrentUserPassword();

      Biff8EncryptionKey key;
      if (userPassword == null) {
        key = Biff8EncryptionKey.create(fpr.getDocId());
      } else {
        key = Biff8EncryptionKey.create(userPassword, fpr.getDocId());
      }
      if (!key.validate(fpr.getSaltData(), fpr.getSaltHash())) {
        throw new EncryptedDocumentException(
            (userPassword == null ? "Default" : "Supplied")
            + " password is invalid for docId/saltData/saltHash");
      }
      return new RecordInputStream(original, key, _initialRecordsSize);
View Full Code Here

Examples of org.apache.poi.hssf.record.crypto.Biff8EncryptionKey

      String userPassword = Biff8EncryptionKey.getCurrentUserPassword();
      if (userPassword == null) {
          userPassword = Decryptor.DEFAULT_PASSWORD;
      }

      Biff8EncryptionKey key;
      if (fpr.getRc4KeyData() != null) {
          Rc4KeyData rc4 = fpr.getRc4KeyData();
          Biff8RC4Key rc4key = Biff8RC4Key.create(userPassword, rc4.getSalt());
          key = rc4key;
          if (!rc4key.validate(rc4.getEncryptedVerifier(), rc4.getEncryptedVerifierHash())) {
View Full Code Here

Examples of org.apache.poi.hssf.record.crypto.Biff8EncryptionKey

    public RecordInputStream createDecryptingStream(InputStream original) {
      FilePassRecord fpr = _filePassRec;
      String userPassword = Biff8EncryptionKey.getCurrentUserPassword();

      Biff8EncryptionKey key;
      if (userPassword == null) {
        key = Biff8EncryptionKey.create(fpr.getDocId());
      } else {
        key = Biff8EncryptionKey.create(userPassword, fpr.getDocId());
      }
      if (!key.validate(fpr.getSaltData(), fpr.getSaltHash())) {
        throw new EncryptedDocumentException(
            (userPassword == null ? "Default" : "Supplied")
            + " password is invalid for docId/saltData/saltHash");
      }
      return new RecordInputStream(original, key, _initialRecordsSize);
View Full Code Here

Examples of org.apache.poi.hssf.record.crypto.Biff8EncryptionKey

    public RecordInputStream createDecryptingStream(InputStream original) {
      FilePassRecord fpr = _filePassRec;
      String userPassword = Biff8EncryptionKey.getCurrentUserPassword();

      Biff8EncryptionKey key;
      if (userPassword == null) {
        key = Biff8EncryptionKey.create(fpr.getDocId());
      } else {
        key = Biff8EncryptionKey.create(userPassword, fpr.getDocId());
      }
      if (!key.validate(fpr.getSaltData(), fpr.getSaltHash())) {
        throw new EncryptedDocumentException(
            (userPassword == null ? "Default" : "Supplied")
            + " password is invalid for docId/saltData/saltHash");
      }
      return new RecordInputStream(original, key, _initialRecordsSize);
View Full Code Here

Examples of org.apache.poi.hssf.record.crypto.Biff8EncryptionKey

    public RecordInputStream createDecryptingStream(InputStream original) {
      FilePassRecord fpr = _filePassRec;
      String userPassword = Biff8EncryptionKey.getCurrentUserPassword();

      Biff8EncryptionKey key;
      if (userPassword == null) {
        key = Biff8EncryptionKey.create(fpr.getDocId());
      } else {
        key = Biff8EncryptionKey.create(userPassword, fpr.getDocId());
      }
      if (!key.validate(fpr.getSaltData(), fpr.getSaltHash())) {
        throw new EncryptedDocumentException(
            (userPassword == null ? "Default" : "Supplied")
            + " password is invalid for docId/saltData/saltHash");
      }
      return new RecordInputStream(original, key, _initialRecordsSize);
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.