IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

How to encrypt files by using pgp?

  • 1.  How to encrypt files by using pgp?

    Posted Fri December 19, 2008 01:52 AM

    I’m just a new guy to use webMethods.
    i want to use PGP.exe to encrypt some files by java service.
    But we tried so many times,just failed.
    can webMethods invoke windows program?

    Our code like this:

    IDataCursor pipelineCursor = pipeline.getCursor();
    String filepath = IDataUtil.getString( pipelineCursor, “filepath” );
    String filename = IDataUtil.getString( pipelineCursor, “filename” );
    String encode = IDataUtil.getString( pipelineCursor, “encode” );
    pipelineCursor.destroy();

    try{
    Runtime rt = Runtime.getRuntime();
    rt.exec("cmd.exe /k start pgp -e “+ filepath + filename +” "+encode);
    }catch(Exception e){

    }
    // pipeline
    IDataCursor pipelineflag = pipeline.getCursor();
    IDataUtil.put( pipelineflag, “rtnflag”, errorMessage);
    pipelineflag.destroy();


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 2.  RE: How to encrypt files by using pgp?

    Posted Fri December 19, 2008 03:47 AM

    Instead of the following:

    I recommend building the entire command string in Java first then passing only that as the parameter to rt.exec(). Much easier to see whether your command string is what you expect that way.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services