Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 25

Thread: Data Encryption Business Function

  1. #11
    Member
    Join Date
    Dec 2000
    Location
    Dallas, TX
    Posts
    148

    Re: Data Encryption Business Function

    How would I create a base64 encoded field in my file through the DD or a base64 encoded field in my business function?

    I understand the reason/concept but not clear on how to create the field attributes. In the DD I see the following possibilities:

    Code Description
    1 Character
    11 Date
    15 Integer
    17 Character (Blob)
    18 Binary (Blob)
    19 Binary
    2 String
    20 Variable String
    55 PeopleSoft UTime
    7 Identifier (ID)
    9 Numeric



    Thanks
    Rob

  2. #12
    Senior Member craig_welton's Avatar
    Join Date
    Oct 2000
    Location
    Litchfield, CT
    Posts
    1,016

    Re: Data Encryption Business Function

    Brian is, of course, right on with the encoding issue. What about using a Binary BLOB (type 18) in your table? I think you'd need to write/update your custom table record in your BSFN where you can do the JDB_SetBLOBSize and copy the byte array.
    Craig Welton
    PatWel Group Inc.
    http://www.patwel.com
    Home of the FREE JDE Object Browser, JDETrace, NERDup and BusBuild+ Tools

    E1 9.0 8.98.4.2 Wintel SQL 2008
    E1 9.2 9.2.1.4 iSeries

  3. #13
    Senior Member
    Join Date
    Mar 2004
    Location
    Fort Worth, Texas
    Posts
    1,574

    Re: Data Encryption Business Function

    Craig is right, a BLOB field is the best solution if you don't need a string representation or the need to display the encrypted value or pass the value through APPL/UBE interconnects.

    Just an FYI on the base64 stuff. I don't know if JDE provides any API's for doing base64 encoding - at least I never found any, there may be some buried some where. What I did when I needed base64 encoding/decoding was to use an open source library to create my own base64 encoding/decoding BSFN that I can use in JDE.
    Brian Oster
    Application Development Manager
    E1: 9.0 (TR9.1.5.1) / 9.2 (TR9.2.2.2)
    JAS/BSSV: Weblogic 12.1.2 / Weblogic 12.2
    ES: Win2008 / Win2016
    DB: MSSQL 2014 / 2016
    WebDev Client: Win7Pro / Win10Pro

  4. #14
    Senior Member Larry_Jones's Avatar
    Join Date
    Nov 2000
    Location
    Spokane, WA, USA
    Posts
    3,250

    Re: Data Encryption Business Function

    Base64 Encoding would use a string data type. Its up to you though to do the encoding / decoding. In addition there are the size issues (extra characters) as already pointed out. Google to find the algorithms used.
    Larry Jones
    E1 9.2 - TR 9.2.2.6 on Win 2016 R2. SQL Server 2016
    Wintel, BI Publisher

  5. #15
    Member
    Join Date
    Dec 2000
    Location
    Dallas, TX
    Posts
    148

    Re: Data Encryption Business Function

    Brian,

    After looking at all my code and running some more testing. I think the base64 conversion will work better for me even if it means increasing the size of my fields.

    Is it possible to post or email me the base64 source code your using and how to call the open source from a BSFN.

    Thanks for all your help, this has been educational to say the least. This is pretty complicated stuff when it is all put together.

    Rob

    [ QUOTE ]
    Just an FYI on the base64 stuff. I don't know if JDE provides any API's for doing base64 encoding - at least I never found any, there may be some buried some where. What I did when I needed base64 encoding/decoding was to use an open source library to create my own base64 encoding/decoding BSFN that I can use in JDE.

    [/ QUOTE ]

  6. #16
    Senior Member
    Join Date
    Mar 2004
    Location
    Fort Worth, Texas
    Posts
    1,574

    Re: Data Encryption Business Function

    There is not a whole lot of documentation that goes with this, only what you find in the .h file. Keep in mind the string passed/returned is a ZCHAR so you will need to transcode between JCHAR/ZCHAR. Here is a code snippet on how to call:

    D58FUP03_B64_ENCODE dsEnc = {0};
    DSD58FUP03A dsEncF = {0};


    dsEnc.nEncodedBytes = (jde_n_byte *)(&dsXfer.nSize);
    dsEnc.src = (void *)pb;
    dsEnc.srcSize = nBinSize;
    dsEnc.dest = dsXfer.chunk;
    dsEnc.destLen = sizeof(dsXfer.chunk);

    dsEncF.idPtrHandle = jdeStoreDataPtr(hUser, (void *)&dsEnc);

    jdeCallObject( _J("AcmeFxfer_b64_encode"), (LPFNBHVR)NULL, lpBhvrCom, lpVoid,
    (void *)&dsEncF, (CALLMAP *)NULL, 0, (JCHAR *)NULL, (JCHAR *)NULL, 0);


    Oh, and there is very little error checking, and by "little", I mean virtually none.
    Attached Files Attached Files
    Brian Oster
    Application Development Manager
    E1: 9.0 (TR9.1.5.1) / 9.2 (TR9.2.2.2)
    JAS/BSSV: Weblogic 12.1.2 / Weblogic 12.2
    ES: Win2008 / Win2016
    DB: MSSQL 2014 / 2016
    WebDev Client: Win7Pro / Win10Pro

  7. #17

    Re: Data Encryption Business Function

    HI Rob - Were able to get this to work. I am able to Encrypt - write to a table and then decrypt. However, when I do this from an application, it throws web exception errors intermittently. Any help is highly appreciated. Thanks
    SAM

    E1 8.12

  8. #18
    New Member mrsteve's Avatar
    Join Date
    Jul 2014
    Location
    Missouri
    Posts
    2
    Hello Brian,

    Could you help me out on implementing this Base64 code? Can you define for me what your dsXfer looks like? As well as the pb variable?

    Thanks,
    Steve

  9. #19
    Hi,
    I have a requirement where i get input a base64 encoded string and need to give back a decoded string. The above bsfn i understand is working with a prt Handle. how can i convert this to work with a string as input and output?

  10. #20
    Senior Member
    Join Date
    Mar 2004
    Location
    Fort Worth, Texas
    Posts
    1,574
    If you are talking about the BSFN above that I attached you would need to write a C BSFN that calls the BSFN above since the BSFN above can only be called by another C BSFN. Then follow the example above. Having said that I think JDE now has its own API calls you can use for encoding/decoding b64 data.

    encodeB64
    decodeB64

    I have not used them since I have always used my BSFN above, but the preferred way would be to use the JDE provided API. Going forward should I ever need to deal with b64 data I would personally use the jde provided APIs.
    Brian Oster
    Application Development Manager
    E1: 9.0 (TR9.1.5.1) / 9.2 (TR9.2.2.2)
    JAS/BSSV: Weblogic 12.1.2 / Weblogic 12.2
    ES: Win2008 / Win2016
    DB: MSSQL 2014 / 2016
    WebDev Client: Win7Pro / Win10Pro

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
The legal restrictions and terms of use applicable to this site are available here.
Use of this site signifies your agreement to the terms of use.
JDELIST is NOT affiliated with JD Edwards® & Company, Oracle or Peoplesoft. Contents of this site are neither endorsed nor approved by JD Edwards® & Company and, or Oracle.