How to set Cipher.IV when decript or encript?

I need to decrypt the encrypted datas sent from remot host via http connection. And the remote host platform is dot net. The data in that platform is encrypted by key and IV. So I think I should provide two parameters the key and the IV to the java decrypt method when the java program decrypt. But I can set the key value only, the IV property is read only and its default value is null!
How can I set the IV value when I decript. Or how should I decrypt the data encrypted by a specific key and IV?
Thank you.

int size = inCipher.getBlockSize();
byte[] tmp = new byte[size];
Arrays.fill(tmp, (byte)15);
IvParameterSpec iv = new IvParameterSpec(tmp);
try
inCipher.init(Cipher.ENCRYPT_MODE, secret, iv);
catch(InvalidKeyException e)
e.printStackTrace();
return;
}

Similar Messages

  • How to set a picture when you long- in

    how to set a picture when you long- in

    How to set a picture when you log in to where ?

  • How to set the selectedIndex when dataProvider is an XML object in DropDownList?

    dataProvider was an XML object
    How to set the selectedIndex when dataProvider is an XML object in DropDownList?
    I do this:
    <s:DropDownList id="dropDownList" requireSelection="true" selectedIndex="2"
                    labelField="lastName" dataProvider="{employeeService.lastResult.employees.employee}"/>
    But always the first item is selected whatever the value of selectedIndex equals to.

    if i understand correctly, you want the selectedindex to be 2 when the DropDownList  displays.
    It might be the case that the dataprovider is being sought after it's already selected its index (as the dataprovider isn't already determined to begin with), so currently it's
         - setting the selected index to default
         - setting the selected index to 2 (your command)
         - getting the dataprovider
         - setting the selected index to default
    try writing a function to set the DropDownList's selected index after it's received the information, or even just attach it to the employeeService result handler.
    for quick testing sake you could just add
    <s:DropDownList id="dropDownList" requireSelection="true" updateComplete="dropDownList.selectedIndex = 2"
                    labelField="lastName" dataProvider="{employeeService.lastResult.employees.employee}"/>
    to see if my theory is correct.

  • In advancedSearch , how to set retainAM=Y when click 'Go' button

    Hi,
    I created advancedSearch in page, when I click on go button, I will get the result in advancedTable ,
    in the page Address, it will be appended '....&retainAM=N&addBreadCrumb=N&oapc=3',
    Now my question is how to set 'retainAM=Y' when I click on 'Go' button

    Hi Gyan,
    In advanched search, click go button, then I will get the result in the advanchedTable,
    and the address of this page will be added the statement '...retainAM=N..'
    Then, for example, click 'about this page', it will go to 'About Page'. click 'Return to Page: ', it will go to the previous page and the address of the page
    still be '..retainAM=N..', but now the result table is blank.
    I want to retain the result we have searched when return to the previous search page.
    I think if we can change the retainAM's value to 'Y' after clicking on 'Go' button, then when we return to this page, retainAM will still be 'Y' so that the
    result will be retained .
    And I found one thing so strange, in advancedSearch criteria, there are four criteria displaying in search region by default, but when I add one new criteria, even I don't erter any value to this new crireria, and then go button, in address of this page, it will be '..retainAM=Y', then when we return this page , it will retain the result

  • How to set color profile when exporting a RAW file version as a JPEG?

    I import my raw files to Aperture and when exporting as a JPEG I want to specify a color profile of sRBG. I cannot see how to set the color profile for the export. Does anyone know how to do this?

    When you go to export versions, edit the presets, and there is a drop down box that lets you select the profile.
    I'd suggest picking up the Aperture book by Luna, Long, and Harrington. Lots of great info there.

  • How to set primary file when check in

    I am trying to check in a document in java class, before i execute the CHECKIN_NEW_SUB service, how to set the primary file, i tried to use putlocal("primaryfile", 'C:/xxx.txt'), but i always got the error msg
    "Content item 'xxxxxx' was not successfully checked in. The content item must have a primary file"
    Thanks.

    Hi,
    Thanks for the response.
    I am trying to update the document thru UCM application with new revision number. When i save the changes, It gives below error.
    "Content Server Request Failed
    Content item '005195' was not successfully checked in. The content item must have a primary file."
    Detailed error from log file.
    <!-- IDCLOG: Error: (22/09/2010 9:44) !csUserEventMessage,sysadmin,grants02:10018!$!csUnableToCheckIn,005195!csCheckinPrimaryFileRequired -->
    <tr><td>Error</td><td>22/09/2010 9:44</td><td>Event generated by user 'sysadmin' at host 'Test102:10018'. Content item '005195' was not successfully checked in. The content item must have a primary file. [ <a style="color:993333" href="javascript:if(typeof show!='undefined')show('0.286966295691763')">Details</a> ]
    <div id="0.286966295691763" style="display:none;" class="details"><pre><code>An error has occurred. The stack trace below shows more information.
    !csUserEventMessage,sysadmin,grants02:10018!$!csUnableToCheckIn,005195!csCheckinPrimaryFileRequired
    intradoc.common.ServiceException: !csUnableToCheckIn,005195!csCheckinPrimaryFileRequired
         at intradoc.server.ServiceRequestImplementor.buildServiceException(ServiceRequestImplementor.java:1760)
         at intradoc.server.Service.buildServiceException(Service.java:1997)
         at intradoc.server.Service.createServiceExceptionEx(Service.java:1991)
         at intradoc.server.Service.createServiceException(Service.java:1986)
         at intradoc.server.DocServiceHandler.validateStandard(DocServiceHandler.java:1119)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at intradoc.common.IdcMethodHolder.invokeMethod(ClassHelperUtils.java:617)
         at intradoc.common.ClassHelperUtils.executeMethodReportStatus(ClassHelperUtils.java:293)
         at intradoc.server.ServiceHandler.executeAction(ServiceHandler.java:79)
         at intradoc.server.Service.doCodeEx(Service.java:490)
         at intradoc.server.Service.doCode(Service.java:472)
         at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1360)
         at intradoc.server.Service.doAction(Service.java:452)
         at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1201)
         at intradoc.server.Service.doActions(Service.java:447)
         at intradoc.server.ServiceRequestImplementor.executeSubServiceCode(ServiceRequestImplementor.java:1071)
         at intradoc.server.Service.executeSubServiceCode(Service.java:3497)
         at intradoc.server.ServiceRequestImplementor.executeServiceEx(ServiceRequestImplementor.java:942)
         at intradoc.server.Service.executeServiceEx(Service.java:3492)
         at intradoc.server.Service.executeService(Service.java:3476)
         at intradoc.server.Service.doSubService(Service.java:3465)
         at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at intradoc.common.IdcMethodHolder.invokeMethod(ClassHelperUtils.java:617)
         at intradoc.common.ClassHelperUtils.executeMethodEx(ClassHelperUtils.java:279)
         at intradoc.common.ClassHelperUtils.executeMethod(ClassHelperUtils.java:264)
         at intradoc.server.Service.doCodeEx(Service.java:507)
         at intradoc.server.Service.doCode(Service.java:472)
         at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1360)
         at intradoc.server.Service.doAction(Service.java:452)
         at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1201)
         at intradoc.server.Service.doActions(Service.java:447)
         at intradoc.server.ServiceRequestImplementor.executeActions(ServiceRequestImplementor.java:1121)
         at intradoc.server.Service.executeActions(Service.java:433)
         at intradoc.server.ServiceRequestImplementor.doRequest(ServiceRequestImplementor.java:635)
         at intradoc.server.Service.doRequest(Service.java:1707)
         at intradoc.server.ServiceManager.processCommand(ServiceManager.java:359)
         at intradoc.server.IdcServerThread.run(IdcServerThread.java:197)

  • How to set a value when right click on af:commandlink ?

    Hi All,
    JDev Ver : 11.1.1.4.0
    How to set a value to property listener on right click of a commandLink ?
    I am having values that are hyper linked using af:commandlink, when i right click on hyperlink, that value i need to get in the managed bean ?
    (While right click i am populating on menu item)
    how to get the value ?
    Give some solutions ?
    thanks
    Gopinath

    Hi,
    Try this code:
    <af:clientListener method="rightClick"
    type="contextMenu"/>
    <af:serverListener type="setValue"
    method="#{beanName.setValueMethodName}"/>
    <trh:script xmlns:trh="http://myfaces.apache.org/trinidad/html"
    id="s13">rightClick = function(event) {
    var source = event.getSource();
    AdfCustomEvent.queue( source, "setValue"
    , {}, false); }
    </trh:script>

  • How to set an item when I redirect using OWA_UTIL.redirect_url

    I am using OWA_UTIL.redirect_url to redirect users.
    but I am lost in how do I set an item doing this. I have an item called :P101_MSG and I want to set it to 1.
    I added &:P101_MSG=1 this: OWA_UTIL.redirect_url ('f?p=&APP_ID.:101:&SESSION.*&:P101_MSG=1* ');
    but that was wrong.
    Can someone tell me the syntax to set P101_MSG=1 when I redirect.
    Howard

    Hi
    I'm not quite sure of what you're doing or where you are but this isn't how you set APEX items in the URL.
    See this example
    f?p=:&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.::::P1_ITEM1,P1_ITEM2:A,BThis sets item1 = A and item 2 = B.
    Is this what you mean (make sue you get the number of colons correct...
    Cheers
    Ben

  • How to set printer options when direct printing from Linux AS Sevr.?

    We have a problem like this: Our app server is a 10g R2. We want to DIRECTLY print reports to a HP LaserJet 1320 PCL 6 which is attached to a Windows print server.
    We can print the reports from the Oracle Forms (we use reports builder to create a PDF in a directory and then using HOST command we print it).
    The command we use is lp -d LaserJet sicl_rcpdebtnt_5.pdfProblem is the printout comes with the top 10% of the page not printed. i.e. the printing starts from about 10% of the PDF. The header and top information is not printed.
    We tried the scaling option: lp -o scaling=75 -d LaserJet sicl_rcpdebtnt_5.pdfBut that also has no effect.
    What can we do to print the entire PDF in ONE page. When we open the PDF in Windows and prints it we have to say Fit to printer margins for the printer's page scaling property.
    How to set this in command line Linux???

    Since you are not printing directly from Reports (destype=printer) this is not really a Reports issue I guess. Maybe you should ask this in a Linux forum.
    However:
    we have to say Fit to printer margins looks to me that there is a mismatch between your Report design and paper format. Check page size and margins in Reports Builder.

  • How to set mouse Icon when Moving on label

    i want to set the ICON when we mouse moved
    what the code i have tried but in vain.
    can u give me sample code to do that task ?
    thanks

    http://www.google.com/search?q=java+change+cursor

  • Secondary monitor on 20"iMac, How to set portrait orientation when running

    How do you set the display rotation in Windows XP?
    I have a secondary monitor (wall-mounted at 90 degrees to normal) that OS X handles just fine (the display preference window provides a rotate function). However, when running Windows XP, the secondary monitor is still available, but I can not find a setting that will rotate the display. I downloaded the Apple Boot Camp ATI driver from AMD's site and the driver version went from 8.39 to 8.43. Still no visible way to rotate the secondary display. I then upgraded Boot Camp to 2.1 after which the ATI driver version went to 8.45. Still no rotate functionality.
    I have tried using the ALT-OPTION-ARROW key with no success (recommended on some obscure Windows XP forum). I also downloaded the Apple Boot Camp Crystal Control Center from the AMD site, but it would not execute after installation (this upon yet another obscure recommendation).
    I also have Windows XP on my MacBook. It uses an NVIDIA driver and it will allow display rotation.
    Any help or advice is appreciated.

    Updating my original post:
    I have resolved the issue. The ATI Catalyst Control Center app (I meant Catalyst, not Crystal in my original post) needs Microsoft's .NET Framework 2.0, which was not included in my original Windows XP installation.
    After downloading and installing the .NET Framework 2.0 package and reinstalling the Catalyst Control Center app, I am now able to rotate the secondary monitor display to the portrait orientation.
    I use the secondary monitor primarily viewing on-line documentation while working with an application on the primary screen. The portrait orientation provides a much better environment for reading documentation as I can view 2+ pages at the same time.

  • How to set setRowKey value when table is populated dynamically

    Hi All
    I have created a view object using only select statement and displaying all the records in it in the table at page load. Table is SelectMany. Now after selecting some records I press submit button. At the backend logic is executed which prints how many rows selected and the values of the selected rows. Everything works fine till here.
    Now when the view object is modified by putting where clause. And the parameter to this where clause is coming from url. When the page is loaded table displays only records based on filter criteria. But the problem begins when I press the submit button. It shows the error: row is null for rowKey:oracle.jbo.Key[AAAQkHAAJAAAACkAAA ]
    I have done some research and found that row key is not set for the displayed records. because at the backend when I am printing the values of keys in selectionState.KeySet it prints only null.
    This thing happens only when table is populated dynamically through url value.
    Can anyone help me how to get the selectionState.Keyset values when table is populated dynamically?

    SOLVED:
    Actually there is no problem with the rowKeys as I mentioned in the post. What happened was that I was executing the query everytime on page load. Second time when the page is loaded the param value was set to null. So row becomes null but on the other hand I am referring the rows by some selected row keys. so the error that row is null for key...
    So now i am storing the param value in managed bean and then referring it in the code.

  • How to set window.status when returning to a page with back button/list?

    It is easy enough to set window.status to application-oriented information when loading a page: do it in a function which is the onload handler for the page's body element. But, when returning to this window from another window with the second window's back button, or selecting the first window from the second window's back list, window.status gets set to browser-oriented information, usually the string "Done". Is there any means by which I can set window.status to application-oriented information when returning to the window via another window's back button/list? What would be really great is if there is an event handler like this:
    window.onreturnviaback = onreturn_via_backhandler;
    Any ideas?

    How about:
    - (void)viewWillAppear:(BOOL)animated
    I use that a lot.

  • How to set a sound when a email will print from the printer.

    I would like to set a sound or a big bip when a email come throught the printer via hpeprint

    You can send the values in query string and access them from
    your flex application. Below is the URL to the page describing how
    to access query string parameters in Flex application
    http://livedocs.adobe.com/labs/flex3/html/deep_linking_5.html#245869
    Hope this helps.

  • How to set item values when redirecting to the same page.

    I just created a redirect button that I want to redirect to the same page and set the 2 page items on the page to the same value they had before the redirect.
    But I can't write:
    Set These Items: P1_Permit_Number,P1_Fishing_Year
    With These Values: &P1_Permit_Number.,&P1_Fishing_Year.
    Because there are no values in the session state, since a submit has not been done.
    So how do I do this?
    I know how to get the values stored in the items, e.g., $v('P1_PERMIT_NUMBER')
    but where do I place that command? It's not allowed under "With These Values"
    And I don't really want to make this a submit button and create a process that says:
    P1_PERMIT_NUMBER := $v('P1_PERMIT_NUMBER') because that would complicate the page too much -- I already have other processes and branches on the pages whose conditions would have to be modified so that they don't run during this scenario.
    Thanks.

    Thanks Gary and Andy. I rewrote the function according to above instructions:
    function redirectToURL()
    var permitNumber = document.getElementById('P1_Permit_Number');
    var fishingYear = document.getElementById('P1_Fishing_Year');
    var url = 'f?p=&APP_ID.:1:&APP_SESSION.::::P1_Permit_Number,P1_Fishing_Year:' + permitNumber +',' + fishingYear;
    window.location.href = url;
    But when I entered a value for permit number and fishing year and redirected, the word "null" appeared in the Permit page item, instead of the permit number that I had entered.
    Remember that I am not submitting here. So if the syntax you showed me, i.e. getElementById('P1_Permit_Number'), searches for the item's session state, then it will be wrong, since there is no session state value for the items at this point. Perhaps that is the reason I got the null?
    If so, what can I do?

Maybe you are looking for

  • How to Open a Specific Folder in the Finder via Shortcut Key

    I'm sure this has been covered elsewhere, so sorry for not finding it... Is it possible to assign a shortcut key to open a specific folder with Automator or AppleScript? There are 4-5 commonly used folders buried 10-11 levels deep on a server and I'd

  • Is the MBA 256gb right for me?

    Hello all, Let me start by saying Im going to be buying a Macbook soon and Im leaning toward the MBA because of the portability and speed it offers. This will be my first Mac. I am a High School Teacher and Im also going to school myself so I need po

  • ECC 6.0 Upgrade - Lot of  Custom Objects - How to make it work ???

    Hi , My client is on HR 4.6c and ESS in standalone ITS and upgrading to ECC 6.0 and EP7.  They have lot of custom objects ( Reports, ABAP Queries, Function Modules etc., ) and lot of customization done in ESS ( Std tcodes copied and developed ESS ser

  • Lion's Finder settings for "always view in column/list mode" not working

    I set specific folders to "always view in column/list" mode using Command+J setting. After upgrading to Lion, Finder seems to always opens folders in the last view mode of the previous folder I open.

  • Using my (signed in) google page as my home page

    I use Windows XP and until recently when I started Firefox it remembered my choice and the homepage was my (signed in) Google home page. There have been Firefox and Google updates (which may be irrelevant) but now I get a page which is suggesting I t