How to make already written Encryption code in JDK 1.3  work in JDK 1.4

Hi,
We are using JCE to encrypt a number.The following code was written in JDK 1.3 and is now on the Live site.
          byte[] publicKeyBytes =new BigInteger("zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", Character.MAX_RADIX).toByteArray();
     EncodedKeySpec spec = new X509EncodedKeySpec(publicKeyBytes);
PublicKey key = KeyFactory.getInstance("RSA").generatePublic(spec);
// Create Cipher
Cipher desCipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
     desCipher.init(Cipher.ENCRYPT_MODE, key);
We are now migrating to JDK 1.4. When I tried to execute the above lines in JDK 1.4, it came back with the following error
"Cannot find any provider supporting RSA/ECB/PKCS1Padding"
Then I downloaded and copied over the iaik_jce_full.jar in \j2sdk1.4.1_05\jre\lib\ext\ folder
and added the following entry in \j2sdk1.4.1_05\jre\lib\security\java.policy
security.provider.1=iaik.security.provider.IAIK
Now, it has started giving me the following error:
java.lang.ExceptionInInitializerError
     at javax.crypto.Cipher.a(DashoA6275)
     at javax.crypto.Cipher.getInstance(DashoA6275)
Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
     at javax.crypto.SunJCE_b.(DashoA6275)
     ... 39 more
Caused by: java.lang.UnsupportedOperationException
     at java.security.cert.CertificateFactorySpi.engineGenerateCertPath(CertificateFactorySpi.java:155)
     at java.security.cert.CertificateFactory.generateCertPath(CertificateFactory.java:470)
     at javax.crypto.SunJCE_d.a(DashoA6275)
     at javax.crypto.SunJCE_d.a(DashoA6275)
     at javax.crypto.SunJCE_b.i(DashoA6275)
     at javax.crypto.SunJCE_b.h(DashoA6275)
     at javax.crypto.SunJCE_v.run(DashoA6275)
     at java.security.AccessController.doPrivileged(Native Method)
     ... 40 more
Can someone tell me where I am wrong and please write the steps I need to follow to make the above code work in JDK 1.4
Bye

in java 1.4 JSSE is default provider
may be u need to use another provider (SunJCE)
see JSSE :
Note for People Implementing Providers
The transformation strings used when SunJSSE calls Cipher.getInstance() are "RSA/ECB/PKCS1Padding", "RC4", "DES/CBC/NoPadding", and "DESede/CBC/NoPadding". For further information on the Cipher class and transformation strings see the JCE Reference Guide.
PS u didnot need load jce. it is into j2se 1.4

Similar Messages

  • How to make a peace of code wait to be exicutes/loading bar

    hello i would like to know how to make a peace of code wait like 3 or 4 secounds before being exicuted
    <example>
    System.out.println("Loading back up prefes...");
    // wait 3 secounds
    System.out.println("Loding hardware prefs...");
    //wait 3 secounds
    //...ect
    </example>
    im a novice java prgrammer and im looking to know how to do that kind of stuff

    >
    yeah i figured now one would help a noob>What?! No-one posted you the codes in that entire 6 minutes you waited patiently?
    As a bonus though, if you don't get the solution in 30 minutes, it's free! ;-)

  • How to make in the loop codes?

    How to make in the loop codes to have like my output(below)?
    For example:
    I am trying to figure out how to make them correct the way I want to have the output.
    String start = "02-01-08";
    String end = "02-29-08";
    Calendar a = new GregorianCalendar();
    while( start <= end ) {
              a.add(Calendar.DAY_OF_WEEK, 7);
              Date d = a.getTime();
              DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
              String ss = df.format(d);
              System.out.println(ss);
    }The output:
    +02-01-08+
    +02-08-08+
    +02-15-08+
    +02-22-08+
    +02-29-08+
    Anybody know how to make it correct?

    artist_tech07 wrote:
    I am confused where is the answer in the doc that you gave me?Read my first reply and read the docs. Then read them again.
    And then re-read this
    To do what you want you need a start and end Dates. These you can compare in one numeric form or the other. For example by using getTime.
    Then during each loop iteration you will need to add *1 day (using the Calendar)* to the start date.
    I am telling you what methods to use. I have told you were you can find those methods. I have given you a link to the Calendar class API. All you have to do is put 2 and 2 together. Or at the very least make an attempt to do so.

  • How to make changes in company code global data

    Hi folks,
    Can some one suggest me how to make changes in company code global data (t code oby6). I want to assign 1 to co code > co Area which is blank.
    Thanks in advance

    Hi,
      actually if you want to change co code > co Area , it is under controlling (maintain controlling area), transaction code  OX06 .You change the assignment control and save it. It is automatic update you COmpany code global data.
    *give me a point if my answer solve your problem.
    Thank You.
    -akma-

  • How can i take off encryption code from itunes for iphone?

    "Encrypt iphone Backup" option got selected on itunes by me while ago  when i hooked my iphone with my computer the first time. Now i can backup my iphone on itunes but cannot restore that backup or any backup on my iphone because i don't remember that encrypted code. whien i try to deselect this option still it asks for the code.
    I got stuck now, what to do..?
    Please help..

    Hi Saini22,
    You may be able to recover the encrypted backup of you iPhone using the suggestions in this article -
    iOS: Troubleshooting encrypted backups - Apple Support
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

  • How to make copy of T-code VL02

    Hello All,
    I want to make copy of t-code VL02, in ZVL02.
    I want my copy transaction should behave in exactly same manner as of VL02.
    Kindly help
    Sachin Yadav

    Hello Sachin,
    The easiest way to create your own transaction from standard one is;
    1. Open transaction SE93.
    2. Goto 'Transaction code->Copy' or simply press Shift+F1.
    3. A pop-up box pops up, specify from transaction as VL02 and Transaction Code as ZVL02, and hit COPY, save as Local Object.
    4. VL02 is now copied to ZVL02. Further, open ZVL02 in Change mode.
    5. Go to 'Edit' -> Change transaction type or simply press Shift+F1.
    6. Choose last radio button; Transaction with parameters (parameter with transaction).
    7. Provide transaction as VL02 (must), screen no as 0101 (opt) and from module pool as SAPMV50A (opt), you can even specify to skip initial screen.
    8. Do remember to check SAPGUI for HTML, SAPGUI for Java and SAPGUI for Windows.
    9. Save and execute your Z transaction.
    Finally, Bob is your uncle.
    Regards,
    Zahack

  • How to make corestorage background encryption progress faster ...

    Accoriding to manual page to corestorage makes encryption in the background, but the process is too slow. Is there a way to make it faster?
    Rise priory? tell corestorage to go foreground? Any ideas besides formatting the volume as encrypted and copying data as this is not always an option? 

     i already restore to factory default my windows OS.. just like fresh installed
    Sounds like the hard drive is beginning to fail.
    Always tell us which L310. See the label on the bottom.
    -Jerry

  • Please teach me how to make the arrangement using Code Interface Node.

    How is what is necessary just to make arrangement (for example, Sine?Wave)
    using Code Interface Node? Please teach me a way.

    Try to get hold of the 'Advanced Analyis' library for labview. It contains VIs for doing FFT! No need to reinvent the wheel.
    If you can't get it and want to take the hard way, try to learn CIN programming by
    - reading the manual (no joke or cynism intended)
    - look for advice in NI's developer zone (www.ni.com/devzone) by using the search phrase 'CIN tutorial': you'll get several links which should be helpful in your case.
    - better than a CIN: try to use the DLL calling mechanisms and compile your C code into a dll. In order to learn dll intewrfacing for LabVIEW, follow the route explained under point 1 and 2 above...
    Good luck,
    Franz

  • HOW TO MAKE MY JAVA APPLICATION CODE INTO A EXE?

    I JUST FINISH WRITING A JAVA APPICATION code USING JCreator.
    there is no error in the program.
    Can someone provide me the steps to change it into a exe so that i can use the application in any computer. THANK YOU!

    You could use Google. I know, it means you need to do some research yourself. But an exe will only work on a Windows platform. Try looking for a tutorial on jar files instead.

  • How to make files written to the workbench server visible

    Hi All,
    I am using dotnet proxyclass to access livecycle server . I am using 'WriteResource' method of liveCycle to write files to the Workbench server.The files are successfully written to the server and I am able to see the files through 'ListMembers' method . But if we are directly checking in the workbench server, I am not able to find those files.They are invisible . Please help me in this.

    @SnakEyez02
    thank you for your suggestion.
    i guess what i want just isn't possible yet. in the rest of the CS5 suite i use (Photoshop, Illustrator, InDesign) the Window Menu -> Application Frame option which keeps it all open/visible all the time. i don't know why Adobe hasn't yet put that option into DW.
    but at 'least' i was hoping there was a hack or extension that'll keep at leat the files panel open/visible all the time.

  • How to make tableUI readyonly with code???

    hi All,
    I have a scenrio were i have two radiobuttons and two table UI(say table1 and table 2). my requriment is when i select  radiobutton1 , table1 has to be editable and table2 has to become readyonly. xxxxxx (please read forum rules)
    Sai Sharan Kalla
    Edited by: Armin Reichert on Jan 17, 2008 10:23 AM

    Hi
    1)Set the <b>keyToSelect</b> =<b>button_1</b> for Radio Button 1
    2)Set the <b>keyToSelect</b> =<b>button_2</b> for Radio Button 1
    3)Create a context value attribute of type String say <b>selectedRB</b> and bind that to the <b>selectedKey</b> property of both the Radio Buttons.
    4)Create a <b>Boolean</b> Value Attribute say "<b>ReadOnlyTable</b>" and bind that to the <b>readOnly</b> property of TableUIElement
    onSelect() // radio Button 1
    if(wdContext.currentContextElement().getSelectedRB().equals("button_1"));
    wdContext.currentContextElement.setReadOnlyTable(true);
    onSelect() // radio Button 2
    if(wdContext.currentContextElement().getSelectedRB().equals("button_2"));
    wdContext.currentContextElement.setReadOnlyTable(false);
    Best Regards
    Chaitanya.A

  • How to make 'Key-Enter' trigger (when clicked on enter key)work like 'F8' key?

    Hi . I have another question to be asked.
    Oracle Forms 6i.
    I have a form in which DEFAULT&SMARTBAR is the menu and there are no push buttons.
    In the form, there is a 'field' named as 'ID No'. After entering 'ID No' in the field and click on 'Execute Query' button from the 'DEFAULT&SMARTBAR' menu, all the details of that respective 'ID No' gets displayed in all the other fields. Even if i press 'F8' all the fields gets displayed with the values.
    But i have a requirement, i.e. after entering 'ID No' and click 'Enter' key , i want all the values to be displayed.
    So i created a 'Key-Enter' trigger with the following code:
    BEGIN
      EXECUTE_QUERY;
    END;
    But after entering 'ID No' and click 'Enter' key, the values are not getting displayed.
    What can i do to make this happen?
    Thank You.

    It depends how your form is created. If your ID item is part of the base table block, you can do this.
    On your ID item, create a KEY-NEXT-ITEM trigger:
    if :system.mode = 'ENTER-QUERY' then
        execute_query;
    else
        next_item;
    end if;
    Now
    - User clicks on enter query (via smart bar icon or F7).
    - User enters ID and clicks <enter> key to execute the query.

  • The window displaying bookmarks is too large (suddenly happened with the new version). I can't figure out how to make the display smaller. Zooming out does not work on the bookmark menu display.

    I have version 4, just downloaded, and a Mac w. OS 10.6. 7.
    The bookmarks display (when I pull down "bookmarks") is much too wide. I can't figure out how to reduce the display size. The window is not persistent so I can't even get you a screen shot.
    Thanks, Sara

    It seems there was a change in Firefox 4 where the width of the drop-down is now determined by the length the longest bookmark name in the folder being displayed. Previous versions of Firefox would shorten a long name like that and add an ellipsis to signify the name was truncated.
    Sorry, I don't know how to change that other than to advise you to edit the name of that long bookmark name and make it less verbose. Just scroll down the list of bookmarks in that wide folder until you see the culprit, then right-click that bookmark and open Properties & edit the Name line at the top of that dialog.

  • How to make a List box connected to a Column Chart work?

    Hi...
    I've just installed my Xcelsius 2008 and am trying to adapt the dashboard I developed in Xcelsius 4.5 version to the new software.
    I have a fish-eye to filter which customer I want to see the performance for.
    I have two list boxes where I can decided which KPI and which factory.
    The chart should adapt according to the choices in the list boxes.
    In the excel spreadsheet I have a long list of rows with a vlookup function based on the two cells connected to the list boxes. This means as insert in for list box I am using position.
    It just doesn't work.
    Can someone help?
    Rosemary

    I have checked all cells and all are correct (I even started the dashboard from scratch).
    I believe it is something to do with my set-up but I have no clue what:
    If I use for my list boxes the position insert in type and choose a cell which I use for my vlookup, meaning:
    4     Insert in cell
    1     NC performance
    2     Pro-active Reporting
    3     Requests Response
    4     POD provision
    5     Damage / Loss Rate
    (From 1 to 5 are the labels for the list box)
    I have a vlookup cell:="C"&W8&"_K" & W18&"_S"&W40 which indicates which data is to be used in the chart (according to the selection, the vlooup fills out a cells range with the corresponding performance).
    For the chart I am using the cells range with the vlookup formulas.
    What could be wrong?
    Thanks

  • How to make a T-code to be displayed after starting SAP

    Hi all, plz let me know how to make our own t-code to be displayed after starting SAP screen.

    Hi,
    It is shown at the bottom right corner of your screen.
    Regards,
    Atish

Maybe you are looking for