首页 > 其他分享 >从OA中将加密文件解密并保存本地,或者保存到共享盘

从OA中将加密文件解密并保存本地,或者保存到共享盘

时间:2024-01-17 11:22:35浏览次数:22  
标签:加密 imagefileid 保存 OA t1 解密 file import weaver

 

1、根据requestid 找出对应docid 

select *  from  formtable_main_291 where requestid=869869

 

2、  利用这个id继续查询

select top 10  *  from  docimagefile where  docid = 46539

找到对应的imagefileid

 

 

3、select t1.imagefilename,t1.filerealpath,t1.iszip,t1.isencrypt,t1.imagefiletype , t1.imagefileid, t1.imagefile,t1.isaesencrypt,t1.aescode,t2.imagefilename as realname,t1.TokenKey,t1.StorageStatus,t1.comefrom from ImageFile t1 left join DocImageFile t2 on t1.imagefileid = t2.imagefileid where t1.imagefileid = 206023

其中filerealpath 为加密文件存放路径

aescode 为加密秘钥

 

 

然后在代码里使用这个imagefileid

package com.test;





import weaver.file.ImageFileManager;
import weaver.general.BaseBean;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.RequestInfo;

import java.io.*;

import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;


public class RfcTest extends BaseBean implements Action{
    @Override
    public String execute(RequestInfo request)   {


        ImageFileManager imageFileManager = new ImageFileManager();
        imageFileManager.getImageFileInfoById(206023);
        InputStream inputStream = imageFileManager.getInputStream();
        File file = new File("F:\\files\\123456.pdf");
        copyInputStreamToFile(inputStream,file);

        request.getRequestManager().setMessageid("90001");
        request.getRequestManager().setMessagecontent("SAP系统业务处理失败或者网络问题,请稍后重试!错误信息:");
        return Action.FAILURE_AND_CONTINUE;




        }

    private void copyInputStreamToFile( InputStream in, File file ) {
        try {
            OutputStream out = new FileOutputStream(file);
            byte[] buf = new byte[1024];
            int len;
            while((len=in.read(buf))>0){
                out.write(buf,0,len);
            }
            out.close();
            in.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }






}

 

 

 

具体关键类是两个类:

weaver.file.ImageFileManager

这是一个利用自己对象生成解密,解zip压缩后的inputstream

 

weaver.file.AESCoder

这是一个加密解密工具类

标签:加密,imagefileid,保存,OA,t1,解密,file,import,weaver
From: https://www.cnblogs.com/stfzhuang/p/17969574

相关文章

  • 多项式求值软件下载Polynomial evaluation software mus 2025 download
    本软件是Windows下64位软件。本软件能计算如a0+a1*x+a2*x^2+......+an*x^n的式子的对b1的求值结果。具体的方法就是在多多项式系数区输入a0到an的值,然后点击计算多项式的结果即可在结果栏算出结果。最大项数为1000项。多项式系数输入时1项1行,从上到下是a0到an,中间不能空行。T......
  • jenkins启动报错:Failed Loading global config
    jenkins启动报错:FailedLoadingglobalconfig 问题起因:想在构建项目中使用复选框(ExtendedChoiceParameter),需要安装ExtendedChoiceParameter插件,但是因为版本过低的原因,导致插件无法正常安装。然后根据提示,就在jenkins的web页面进行了自动升级。但是在升级过程中......
  • 解密:Redis速度快的原因
    Redis是一种基于内存的数据存储系统,其速度非常快。以下是几个原因:1. 数据存储在内存中:Redis将所有数据存储在内存中,因此它可以非常快速地读取和写入数据,而无需像传统数据库那样将数据从磁盘读取和写入磁盘。2. 单线程模型:Redis采用单线程模型,这意味着它不需要在不同线程之间进......
  • loading改用react hooks
    //子组件importReact,{useState,useEffect}from'react';import{Modal}from'antd';constChildComponent=({onCancel})=>{const[loading,setLoading]=useState(true);//useEffect监听父组件取消事件useEffect(()=>{......
  • GUI_Download的Codepage参数 转载
    http://blog.chinaunix.net/u1/40527/showart.php?id=499557 DATA:CODEPAGETYPEABAP_ENCODVALUE'8400'.DATA:O_FILETYPESTRING.O_FILE=filename.CALLMETHODCL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD EXPORTING   FILENAME         =O_FILE   F......
  • springBoot通过AOP(面向切面编程)实现自动保存请求日志
    1.定义注解importjava.lang.annotation.ElementType;importjava.lang.annotation.Retention;importjava.lang.annotation.RetentionPolicy;importjava.lang.annotation.Target;@Target(ElementType.METHOD)//指定该注解只能应用于方法上@Retention(RetentionPolicy.......
  • AntDesign文件上传前端文件类型控制 不采用Upload.IGNORE来限制出现在upload_list中
    <a-form-item label="附件" :label-col="{span:4}" :wrapperCol="{span:4}" :colon="false" > <divclass="upload"> <a-upload :fileList="uploadFileList&qu......
  • Road Extraction from Remote Sensing Images Using the Inner Convolution Integrate
    landbench里面,李老师提到的encode-decode。remotesensing,大类是2区,小类是2到3区。分类的题目:“利用内部卷积集成编码器-解码器网络和定向条件随机场从遥感图像中提取道路”(pdf)“RoadExtractionfromRemoteSensingImagesUsingtheInnerConvolutio......
  • Encountered fatal error while reloading routing: Routing trace file does not mat
      efinity编译在routersetup时候报错Encounteredfatalerrorwhilereloadingrouting:Routingtracefiledoesnotmatchnetlist(netlistnetcount24888v.tracenetcount0).  解决方案:检查客户工程的PNR页面。beneficialskew页面是否打开,如果是on状态,试......
  • zabbix对接grafana,优化dashboard
    zabbix对接grafana #下载grafana官网地址https://grafana.com/grafana/download/9.4.7?pg=graf&plcmt=deploy-box-1官网有下载指导  #开启并设置开机自启 #安装的服务器地址加ip:3000/login账号,密码默认都是admin     创建新数据   ......