Java EE AESKey equivalent

What is the equivalent of AESKey in Java EE?

Currently, I am using this code to encrypt

private static ubyte [] encrypt (byte [] encryptionKey, byte [] plaintext) throws Exception {}

Encryption cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
Key SecretKeySpec = new SecretKeySpec (encryptionKey, "AES");
Byte [] x is Cipher.init (Cipher.ENCRYPT_MODE, Key);.

Return cipher.doFinal (x);
}

and it returns java.security.InvalidKeyException: not valid AES key length:... bytes

Well, SecretKeySpec key = new SecretKeySpec (encryptionKey, "AES"); is the same as AESKey

It was just restriction of encrypting Java that restrict only 128-bit key length, but RIM does not restrict the length of key in his crypto AES API...

Tags: BlackBerry Developers

Similar Questions

  • Name of the dynamic pageFlowScope variable on a page of amx, possible?

    Hi all

    I have a problem that I can't seem to move at the moment. I have java classes that try to update some data, and if it is not successful it returns the ID of the control that contains the error. Then I take this control id and use it to highlight the field in error so that the user knows where it is. Usually, this works very well for any other than to a list view.

    For a grid/listView error control is returned in the form of something like "1.14" of the appeal of java, this is equivalent to the number of the line '1' and the id of the control "14". I can easily strip away the '. ' in java but I need a path in my AMX page to define a variable on the fly for example pageFlowScope #{pageFlowScope. {{} row.rowKey} 14} but I get EL analysis of errors try like this, the error is "ERROR_EL_PARSER_NESTED_EL_NOT_SUPPORTED". Basically, I'm trying to have conditional styles depending on whether E {pageFlowScope.114} is set to 1 or not. I can't imagine a better way to implement this in a listView?

    I can only suggest a medium crude to achieve.

    One way to see dynamic values in EL is to use a hash table and use the dynamic value as the key. I would record a HashMap per input element and then store the error with the line indicator not. You can even create your own implementation of HashMap and hoist the flag when running by overloading the get method.

    [For example #{pageFlowScope.elem14ErrorMap [row.rowKey}]

  • OBIEE - navigate to "Pierce" effect

    Hello


    I have developed on OBIEE for a month now and have written that some reports with navigate a dashboard in order to coordinate the multiple reports on another page of dashboard.

    It works very powerfully, simply by putting filters 'invite' on all the fields of the target report and for the navigate to the dashboard page - not a single nice - very nice - report - impressed - love it!


    BUT -I was not able to reproduce this when trying to achieve the same effect with linked folders, based on tables, with the same field names and data values - when I want to move from one reports based on folder has another report, based on the folder B - works to navigate, but the content of the report is the complete set of data not limited by the "prompt" filter and the value one clicked to start the navigation.

    Is there a trick to this, can anyone help please?



    Thank you

    Robert.

    Know that OBIEE is primarily a BI tool - not a forms 9i, Java swing or equivalent same asp.net (sorry!)-, but the solution only includes features of publication (postback) standard - and I've seen dealing with XML for easy insertion and put messages updated to allow a simple web form style feature.

    Yeap it's writeback I mention. You can build things around him, but Oracle says explicitly that there are very limited ways: http://download.oracle.com/docs/cd/E10415_01/doc/bi.1013/b31766.pdf (page 93f).
    So, you're dead on your judgment ("post in a field of comment or a similar feature"). Regarding the "sophisticated data entry" for me, the question arises: why would you do the data entry sophisticated in an analysis-oriented database? Forecasting and planning tasks, there are applications purpose-built from the Hyperion product stack.

    In all cases, you should monitor and keep the distinctions between 'normal' analysis of data and that you write in the clear. Users normally get confused with the analyses that pull data from sources of refresh cycles for example.

    provide style budget reports to users

    Now you're in territory Hyperion Planning: http://www.oracle.com/appserver/business-intelligence/hyperion-financial-performance-management/hyperion-planning.html

    tell you what I have described is beyond the scope of the intended OBIEEs feature?

    Usual answer: "it depends." Of course, you can do OBIEE do all this. The question is: is this really the right tool to do? It is worth the effort and hassle? Wouldn't be easier, cheaper and more advantageous for the company just to buy an app that is specifically designed for this and therefore offers you 100 times the functionality that you can build in the time it takes to implement a standard set?
    Therefore, as always... make or buy. Just keep in mind that if you choose a standalone application he won't say that the link with your Analytics data is lost... OBIE can simply connect to what it is and still represent consolidated reports between the systems.

    See you soon,.
    C.

  • equivalent of a feature of c# Java

    Hi all.

    In c#, you can use System.Reflection.Emit. DynamicMethod to generate the code compiled during execution. Is there an equivalent feature in java? I know that to use a compiler, you need a JDK, but if you only have a JRE, is there a way to generate a compiled when executing code?

    Thank you.

    There is equivalent functionality in java to make up for not having the regular comiler in the JRE.

    No - compile you need a compiler. You don't need the whole JDK, but the compiler is located in the tools.jar, which is part of the JDK.

  • What is the equivalent of HashTable of Java in PL/SQL

    Hello

    I write a java method that calls a pl/sql procedure. The procedure must accept a single input parameter and I actually pass the parameter of java as a hash table

        protected void doDML(int operation, TransactionEvent e) {
            // super.doDML(operation, e);
            Hashtable record = new Hashtable();  
            String columnName = null;
            if (operation == DML_INSERT) {       
             for (int i =0; i<getAttributeCount(); i++) {
                   columnName = this.getEntityDef().getAttributeDef(i).getColumnName();
                   System.out.println(columnName+ "=>"+this.getAttribute(i));             
                   record.put(columnName, this.getAttribute(i));               
               }
                System.out.println(record.size());
             insertRow(record);
             
            }
            
        }
    
    
        public void insertRow(Hashtable table) {
            CallableStatement st = null;
            try {
    
    
                // 1. Define the PL/SQL block for the statement to invoke
                String stmt = "begin test_tab_pkg .insert_row(?,?); end;";
                // 2. Create the CallableStatement for the PL/SQL block
                st = getDBTransaction().createCallableStatement(stmt, 0);
                // 4. Set the bind values of the IN parameters
                st.setObject(1,table);
    
    
                // 3. Register the positions and types of the OUT parameters
                st.registerOutParameter(2, Types.VARCHAR); //P_REQ_AMT_BASE
    
    
                // 5. Execute the statement
                st.executeUpdate();
                //   setReqAmountBase(st.getString(8));
                setErrorMsg(st.getString(2));
                System.out.println(getErrorMsg());
            } catch (SQLException e) {
                throw new JboException(e);
            } finally {
                if (st != null) {
                    try {
                        //Close the JDBC CallableStatement
                        st.close();
                    } catch (SQLException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
    

    as see you in the code, the method "::InsertRow()" runs a procedure from pl/sql "test_tab_pkg.insert_row(?,?)".

    the first parameter is IN, and the second was RELEASED.

    The problem is that I don't know what type of data I use PL/SQL for parameter 1.I tried an array of records, but it fails. This is my code

    CREATE OR REPLACE package HR.test_tab_pkg 
    is
    type ADF_ENTITY is table of VARCHAR2(30) index by binary_integer;
    
    
    procedure insert_row  (prec in ADF_ENTITY , perror out varchar2 ) ;
    
    
    end  ;
    /
    

    CREATE OR REPLACE package body HR.test_tab_pkg 
    is
    procedure insert_row  (prec  ADF_ENTITY , perror out varchar2 )
    is
    
    
    begin
    
    
    
    insert into test_tab (tab_id  , description ,trx_date  ) 
    values (prec(0)  , prec(1) ,SYSDATE ) ;
        
    perror:='0';
        
    exception 
    when others
    then perror:=sqlcode ;    
    end insert_row;
    
    
    end  ;
    /
    

    When I test my method this error occurs

    java.sql.SQLException: invalid column type

    I need to make the java method's hash table to a PL/SQL procedure. How to do this?

    Thank you

    Hi Tarek,

    Associative arrays works similar to Java hash tables, it is a set of key-value pairs.

    Look at this link:

    Documents and Collections of PL/SQL

    I hope that helps!

    Concerning

    Carlos

  • Is there a java Vector class ActionScript equivalent?

    I am writing a Flash game that is in collision detection.  I need to browse through all the objects on the stage to check collisions between objects.  I can not only check for collisions between objects and player because there are collisions of object with objects (ball with platform, etc.).

    Objects are generated dynamically, but every object that is added to the stage is added in my top-level controller class (class controller has a method public requestAddChild).  Since there is no dynamic object generation (mainly chips), I have not exactly all references to each object on the stage, written within the class itself.  So I think adding them to an array type data structure that works like the java Vector class.  In other words, a list that does not have a size specified at the start that you can always add new items to.  There are clues as in tables, but there is no limit to the size of the list.  Whenever I have add an object to the stage, I want to add the object to the list.  Then, whenever I check the collision, I can iterate through this list.

    Is there such a data structure?

    If not, is there a method to get all the objects that are present on the scene?

    Flash player 10 supports a vector class, but I don't see that is what you need.

    Why not use the class array flash?  It meets all of the conditions you mentioned.

  • equivalent to Java &amp; quot; instanceof &amp; quot; operator

    I came from the world of Java and Flex to learn right now. I wonder if Flex has a way to check the type of an object class to see if the object is an instance of the class (or a subclass of the class). In Java, I would usually use operator 'instanceof' as:
    If (circle instanceof formed)...

    Is there something like this in Flex?

    Thank you

    Yep:

    If (the circle shape)...

  • I have update to java 6 4, 7 and 11 do I all three, I have a dell latitude c610 laptop also I have avg antivirus but says out why virus protection

    What programs do I have and what they are and what can remove chrome Google java 6 update 4,7,11 I have firefox, it's the same thing and something called microsoft redistrubate

    1. you want to only have the latest Java installed. Go to add/remove programs and uninstall all older versions. Then download and install the latest version of JRE 6 Update 21.

    http://Java.com/en/download/manual.jsp

    2. Google Chrome is a browser. Mozilla Firefox is another browser and Internet Explorer. A browser is software that allows you to 'see' the Internet. It does not hurt to have several browsers installed, but if you do not want Google Chrome, uninstall it from Add/Remove programs.

    3. make sure that your computer is free from virus/malware by performing a thorough analysis. At least do preparatory work and scan with MalwareBytes' Anti-Malware, as described here:

    http://www.elephantboycomputers.com/page2.html#Removing_Malware

    4. I'm not sure what "redistrubate microsoft something called ("restributable"?). [translation] "means, but if it persists after that you did the malware scanning please post back with the missing details.

    If you can't do the work yourself (and there is no shame in admitting this isn't your cup of tea), take the machine to a professional computer repair shop (not your local equivalent of BigComputerStore/GeekSquad).

    MS - MVP - Elephant Boy computers - don't panic!

  • cannot decrypt the message of the java Server

    My application receives emails which are encrypted with AES/CBC/PKCS5Padding. My problem is that I can't decipher them well, I always get weird characters and portions of the original message. Y at - it any incompatibility between PVE PKCS5Padding and PKCS5Padding of Blackberry? I tried with atheart/CBC/PKCS5Padding encryption, but you have the same problem. I even tried to import BouncyCastle in my blackberry application, but it gave rise to a more complex problem: application would not start due to a problem of verification.

    This is the encryption and decryption methods I used.

    Byte [] use = "abcdefghijklmnop".getBytes (); key used by the server and Pocket PC

    Encryption of the Java Server:

    ...

    public static ubyte [] encrypt (byte [] input) throws... {

    SecretKeySpec keySpec = new SecretKeySpec (use, "AES");
    IvParameterSpec ivSpec = new IvParameterSpec (rawKey);

    Encryption cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");

    Cipher.init (Cipher.ENCRYPT_MODE, keySpec, ivSpec);

    Return cipher.doFinal (input);

    }

    Blackberry decryption:

    ...

    public static ubyte [] decrypt (input byte) shots... {

    Key AESKey = new AESKey (rawKey);
    IV InitializationVector = new InitializationVector (rawKey);
    ByteArrayInputStream is = new ByteArrayInputStream (input);
    DecryptorInputStream stream = DecryptorFactory.getDecryptorInputStream (key,
    is "AES/CBC/PKCS5", iv);
    output Byte [] = new byte [stream.available ()];
    Stream.Read (output);
    is. Close();

    return output;

    }

    If one of you managed to decipher any type of encryption PVE or BouncyCastle, please help me.

    I finally got to work. The problem was that I have encrypted text and then sent as an email. The result of the encryption is a byte array that in order to send an email I've converted to a string. That was the main problem. I managed to solve this problem by placing the bytes encrypted in an attachment with a particular content type: application/xrimdevice-mycontent. In collaboration with the SupportedAttachmentPart I managed to get my intact encrypted bytes. Yet, there are a few problems with the padding, usually I don't get any errors if the length of the ciphertext is a multiple of 16 (using the 16-byte encryption key).

    I tested it and it worked perfectly with AES/ECB/PKCS5. When you use character mode the first CBC Article 10 or 9 not decrypted well no.

    For those who want to implement the PKCS7 I sugest using the BouncyCastle j2me version. I managed to make it work by adding to my project all necessary decryption since the source code of the Castle inflatable j2me.

  • How to build a query using Java HTTP

    Hello

    I am fairly new and I looked on many positions and tried several implementations but no work and seem to be too complex for what I'm trying to do. All I want is to have my application use a connection to the internet and send an http request to a url and returns the chain reaction in my application.

    It seems that BB should have some kind of class to do what I can imagine it is common but I found all the solutions seem to have manually coded methods to check the available connections etc...    Am I wrong to think this should be simple or can I just can't get the right classes. I imagine that someone came up with a class already.

    I'm looking for a curl or equivalent LWP for BB, which is smart enough to recognize what connection to use.

    If it does not exist, I would appreciate a nod in the right direction.

    Unfortunately, this is probably * the * party the more complex learning to develop for the Blackberry.

    You will find a bit of info in the thread sticky at the top of this forum (by Peter Strange).

    There is also a factory 5.0 connection method, but of course, it's pretty useless since 99% of devices are running a more low level of operating system.

    Here is a link to a factory for connections 'rolling', maybe you will find useful.

    http://www.versatilemonkey.com/HttpConnectionFactory.Java

  • uninstalled Java, try t re-in-stall, cannot because of "this action is only valid for products that are currently installed Windows 7.

    Having Windows 7 Service Pack 1.  Had to uninstall Java/Pogo games but when you try to reinstall Java a window pops up saying, "this action is only valid for products that are currently installed.

    I used Revo UN-install, but when I checked the Panel he showed Java with a folder instead of the Java icon.  I tried to find what file or folder, it is the case, find nothing.  Please help if you can.

    Thank you.

    This sounds like your problem? - http://forums.whatthetech.com/index.php?showtopic=104537&hl=This+action+only+valid+products+that+currently+installed+Windows

    It lists the reg keys his looking, then you might check to see if you put them before doing anything.

    Back up your registry and set a restore point before taking any action - assuming that is your problem.

    Also, if you download and run the file, AV check it before running it - just in case.

    NOTE: the above was found by google, I have not tried that I have not had the error. I can't say if it works or not.


    PS - Also, FYI, while the research I found this http://support.microsoft.com/kb/893048 , but it seems specific to XP - SP2. Don't know if there is an equivalent W7.

  • Java.lang.NoClassDefFoundError blackBerry Smartphones

    I have a Bold 9900 using 7.1.0.714 platform 5.1.0.532.

    Facebook does not work because instead, I get an untrapped exception: java.lang.NoClassDefFoundError.

    I need help to solve this problem please

    Hello and welcome to the community!

    There is virtually no diagnosis of those - they are the equivalent of random errors in Windows for which trace the root cause is futile. Basically, here's the last out in the programming code - some event occurred for which there is no event handler in the code. The patch is an update of the code that handles the event... but, again, what is the event is almost impossible. So, there are a few things to try:

    Sometimes, the code simply is damaged and needs to be updated - just like a reboot:

    • Each time a random strange behavior or slow creeps, the first thing to do is a battery pop reboot. With power ON, remove the hood back and remove the battery. Wait a minute, then replace the battery and cover. Power on and wait patiently through the long reboot - about 5 minutes. See if things return to functioning. Like all computing devices, BB suffers from memory leaks and others... with a hard reboot is the best remedy.

    If it doesn't boot properly, then you need to try Safe Mode:

    • KB17877 How to start a BlackBerry smartphone in safe mode

    There may be a code updated to the value of the carrier - check out them through this Portal:

    The toughest possible causes are a bad application behave. To find it, there are two options. Is to see if you can read the log file:

    Go to the home screen. Hold down the "alt" key and type "lglg". (You won't see anything as you type). This will bring up the log file. Scroll down (probably a lot of pages) until you see a line that says "eception execption. Click on this line. The application name will be in the info. Alternative methods to implement the newspapers are in this KB:

    • KB05349 How to activate, view, and extract the the event logs on a BlackBerry smartphone

    The other method is to remove the apps one at a time, wait a while between the two (I usually recommend a week), until the problem stops... revealing the offending application. Yet another method is to recharge the BB OS itself, leaving little time between the addition of other applications on the BB in order to be able to determine exactly what is the cause.

    Good luck and let us know!

  • Untrapped exception blackBerry Smartphones: java.lang.illegalstateexception on bold 9900

    Hello

    Bold 9900, 7.1.0.746 (2108)

    whenever I restart my phone, the message (eception exception: java.lang.illegalstateexception) always showed.

    and I have to click 'OK' 4 times before the message passed...

    I can not invite any person on BBMessenger and my group message does not appear on the message application

    So frustrating

    Help me please...

    Hello and welcome to the community!

    There is virtually no diagnosis of those - they are the equivalent of random errors in Windows for which trace the root cause is futile. Basically, here's the last out in the programming code - some event occurred for which there is no event handler in the code. The patch is an update of the code that handles the event... but, again, what is the event is almost impossible. So, there are a few things to try:

    Sometimes, the code simply is damaged and needs to be updated - just like a reboot:

    • Each time a random strange behavior or slow creeps, the first thing to do is a battery pop reboot. With power ON, remove the hood back and remove the battery. Wait a minute, then replace the battery and cover. Power on and wait patiently through the long reboot - about 5 minutes. See if things return to functioning. Like all computing devices, BB suffers from memory leaks and others... with a hard reboot is the best remedy.

    If it doesn't boot properly, then you need to try Safe Mode:

    • KB17877 How to start a BlackBerry smartphone in safe mode

    There may be a code updated to the value of the carrier - check out them through this Portal:

    The toughest possible causes are a bad application behave. To find it, there are two options. Is to see if you can read the log file:

    Go to the home screen. Hold down the "alt" key and type "lglg". (You won't see anything as you type). This will bring up the log file. Scroll down (probably a lot of pages) until you see a line that says "eception execption. Click on this line. The application name will be in the info. Alternative methods to implement the newspapers are in this KB:

    • KB05349 How to activate, view, and extract the the event logs on a BlackBerry smartphone

    The other method is to remove the apps one at a time, wait a while between the two (I usually recommend a week), until the problem stops... revealing the offending application. Yet another method is to recharge the BB OS itself, leaving little time between the addition of other applications on the BB in order to be able to determine exactly what is the cause.

    Good luck and let us know!

  • Invoking a Java OPC file

    I need to read a Java OPC file. I found there is a built-in activity "reading generic Java file" in CPO. But I'm not sure what should be the target, I need to point this activity. Also, can I use the output of this Java file as an input for other CPO workflow activities?

    Can someone help me on this please? It would really help if there are examples for the same thing.

    Thank you

    Anish

    You have a number of ways to do this through one of the other activities of operating system.

    I'll assume that your Java (.jar?) file is available (accessible) Windows or Linux computer. And that you can actually "run" using java.exe on Windows or equivalent command-line Linux with the appropriate switches.

    You will need to:

    1. create a new target for the computer where the file is accessible. It would be a "Windows computer" or system Unix/Linux. If your file is accessible on a process Orchestrator server, you don't need to create a new target, such as a parameter is automatically created. Note that the objectives of the Unix/Linux system require that SFTP is enabled/configured on the machine.

    2. in the process (where you want to "run" your Java file), you need to add a new activity. The activity that you add will depend on your needs. For the Windows computer, this might be 'Execute Windows Command' (for the execution of the simple command line) or "Run Windows Script" / "Run Windows PowerShell Script" If you need more than just run a command (for example, load environment variables or create a config file). For Linux/Unix system, you can use run Unix/Linux SSH command or a Script run Unix/Linux SSH respectively. Configure the activity to use java.exe or its equivalent to run your java file.

    3. the property of "Output" of the activity that you used in step 2 will be the output of your java file (more, possibly, other data if you use more than the execution of a single command). You can refer to the output property of the activity of the following activities.

    Hope this explanation helps.

    Thank you

    Svetlana

  • Error java.lang.NullPointerException for blackBerry Smartphones verifying my SMS Inbox

    Need help with my BB 9000...

    I lost the SMS icon and cannot receive SMS on my phone.

    I get java.lang.NullPointerException error whenever I reboot my phone.

    I can always call and use other apps except receive sms... Help please...

    yhang23 wrote:

    Need help with my BB 9000...

    I lost the SMS icon and cannot receive SMS on my phone.

    I get java.lang.NullPointerException error whenever I reboot my phone.

    I can always call and use other apps except receive sms... Help please...

    Hello!

    There is virtually no diagnosis of those - they are the equivalent of random errors in Windows for which trace the root cause is futile. Basically, here's the last out in the programming code - some event occurred for which there is no event handler in the code. The patch is an update of the code that handles the event... but, again, what is the event is almost impossible. So, there are a few things to try:

    Sometimes, the code simply is damaged and needs to be updated - just like a reboot:

    • Each time a random strange behavior or slow creeps, the first thing to do is a battery pop reboot. With power ON, remove the hood back and remove the battery. Wait a minute, then replace the battery and cover. Power on and wait patiently through the long reboot - about 5 minutes. See if things return to functioning. Like all computing devices, BB suffers from memory leaks and others... with a hard reboot is the best remedy.

    There may be a code updated to the value of the carrier - check out them through this Portal:

    The toughest possible causes are a bad application behave. To find it, we need to eliminate apps one at a time, wait a while between the two (I usually recommend a week), until the problem stops... revealing the offending application.

    Good luck and let us know!

Maybe you are looking for

  • Satellite L855 - question about charging battery

    Hello!I have the Satellite L855-188. I have a question. My rating is at home, almost everytime. So how do I load it? Can I use it when it is still connected to electricity? Or sometimes I have to disconnect?

  • Two module I/O servers. a serial port

    is this possible? It makes sense that you would wan't to put multiple devices on the same network series, so you do not have add extra ports to control you. I can't find the answer. I ould think that the API manages the port behind the scenes sharing

  • Problem with the series of read/write

    Hi all I don't know if this belongs here or on one of the guidance material, but I thought I would start here. I have two devices which I am currently trying to contact via the serial ports on a PXI chassis in real time.  In both cases, I series of s

  • How to transfer iTunes to the flash player library

    Original title: itunes for usb flashdrivesI need to download my itunes collection on a USB of mass media. When I select the usb option poes playlist not come, just the will of the cd player. How can I format or anything else I need to do for this dow

  • Programs stop responding and start over

    Programs to stop responding For the last few weeks, of programs such as Internet Explorer, Excel, etc., which I use on a daily basis, suddenly stop responding and start again after a few minutes. I use a laptop, that I keep regularly updated with upd