Package org.apache.poi.poifs.crypt

Examples of org.apache.poi.poifs.crypt.EncryptionInfo


        bos.write("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n".getBytes("UTF-8"));
        ed.save(bos, xo);

        final byte buf[] = new byte[5000];       
        LittleEndianByteArrayOutputStream leos = new LittleEndianByteArrayOutputStream(buf, 0);
        EncryptionInfo info = builder.getInfo();

        // EncryptionVersionInfo (4 bytes): A Version structure (section 2.1.4), where
        // Version.vMajor MUST be 0x0004 and Version.vMinor MUST be 0x0004
        leos.writeShort(info.getVersionMajor());
        leos.writeShort(info.getVersionMinor());
        // Reserved (4 bytes): A value that MUST be 0x00000040
        leos.writeInt(info.getEncryptionFlags());
        leos.write(bos.toByteArray());
       
        dir.createDocument("EncryptionInfo", leos.getWriteIndex(), new POIFSWriterListener() {
            public void processPOIFSWriterEvent(POIFSWriterEvent event) {
                try {
View Full Code Here


     
    } else if (type.equals(Filetype.Compound)){
     
          try {
        POIFSFileSystem fs = new POIFSFileSystem(is);
        EncryptionInfo info = new EncryptionInfo(fs);
            Decryptor d = Decryptor.getInstance(info);
            d.verifyPassword(password);
           
        InputStream is2 = d.getDataStream(fs);
        final LoadFromZipNG loader = new LoadFromZipNG();
View Full Code Here

                        extractor.parse(xhtml, metadata);
                    }
                    break;
                case ENCRYPTED:
                    EncryptionInfo info = new EncryptionInfo(filesystem);
                    Decryptor d = Decryptor.getInstance(info);

                    try {
                        if (!d.verifyPassword(Decryptor.DEFAULT_PASSWORD)) {
                            throw new EncryptedDocumentException();
View Full Code Here

                 new OutlookExtractor(root, context);

           extractor.parse(xhtml, metadata);
           break;
        case ENCRYPTED:
           EncryptionInfo info = new EncryptionInfo(root);
           Decryptor d = Decryptor.getInstance(info);

           try {
              // By default, use the default Office Password
              String password = Decryptor.DEFAULT_PASSWORD;
View Full Code Here

                        extractor.parse(xhtml, metadata);
                    }
                    break;
                case ENCRYPTED:
                    EncryptionInfo info = new EncryptionInfo(root);
                    Decryptor d = Decryptor.getInstance(info);

                    try {
                        if (!d.verifyPassword(Decryptor.DEFAULT_PASSWORD)) {
                            throw new EncryptedDocumentException();
View Full Code Here

                 new OutlookExtractor(root, context);

           extractor.parse(xhtml, metadata);
           break;
        case ENCRYPTED:
           EncryptionInfo info = new EncryptionInfo(root);
           Decryptor d = Decryptor.getInstance(info);

           try {
              // By default, use the default Office Password
              String password = Decryptor.DEFAULT_PASSWORD;
View Full Code Here

                        extractor.parse(xhtml, metadata);
                    }
                    break;
                case ENCRYPTED:
                    EncryptionInfo info = new EncryptionInfo(filesystem);
                    Decryptor d = new Decryptor(info);

                    try {
                        if (!d.verifyPassword(Decryptor.DEFAULT_PASSWORD)) {
                            throw new TikaException("Unable to process: document is encrypted");
View Full Code Here

                 new OutlookExtractor(root, context);

           extractor.parse(xhtml, metadata);
           break;
        case ENCRYPTED:
           EncryptionInfo info = new EncryptionInfo(root);
           Decryptor d = Decryptor.getInstance(info);

           try {
              // By default, use the default Office Password
              String password = Decryptor.DEFAULT_PASSWORD;
View Full Code Here

TOP

Related Classes of org.apache.poi.poifs.crypt.EncryptionInfo

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.