Detecting key length restrictions

Is there an easy way to determine programatically if a user has the basic JDK 1.4 JCE implementation or has installed the unlimited strength version? Basically, I want to present a user with a means of setting the key length, but I need to know what the max is.

Let me be a little more specific. I'm presenting the user with a GUI widget (JSlider, JTextField, whatever) that will allow them to enter the desired keysize. After they enter the keysize, they hit an 'Encrypt" button and the program goes off and does something like the following:
     int keysize = keySizeWidget.getValue()
     KeyGenerator kg = KeyGenerator.getInstance("Blowfish");
     kg.init(keysize );
     SecretKey sk = kg.generateKey();
     Cipher c = Cipher.getInstance("Blowfish");
     c.init(Cipher.ENCRYPT_MODE,sk);
Now, if the user selects a keysize of 448, but only has the default JRE 1.4 policy files (i.e. they haven't downloaded the unlimited versions), then I get a SecurityException at the call to c.init() reporting an unsupported keysize. However, a long time passes before the exception is thrown, and the user has no feedback when they provide the keysize that the value will be rejected later when they hit the encrypt button.
Is there any means of finding out ahead of time what keysizes a given Cipher object will accept? It would be nice to setup the interface so that they can only select valid keysizes (i.e set the maximum value of a JSlider to 128 if they don't have the unlimited encription support).
Any help would be appreciated.

Similar Messages

  • Key length 120 (Restricted functionality) Error

    Hi Experts,
    I created a ZTable with 4 Primary Key fields.The sum of all these fields is 175.When I am activating the table it is showing the following error.
    Key length > 120 (Restricted functionality)
    Message no. DT214
    The key length, i.e. the sum of the field lengths of all the key fields of the table, is more than 120 bytes.
    Is there any solution to solve this problem?
    Regds,
    Sam.

    Dear saju sam
    Please goto change table in SE11 and remove the check boxes for primary key in table so that number of primary keys are reduced.And then activate before transporting.
    Please put ratings if this helps .

  • Key length message - how to correct it?

    I added a couple of fields two an existing Z table (APPL0)
    and when I activate I am getting this warning message.
    Table ZMATLIST: Key length > 120 (Restricted functionality)
    Message no. DT214
    Diagnosis
    The key length, i.e. the sum of the field lengths of all the key fields of the table, is more than 120 bytes.
    System response
    This is a warning.
    Procedure
    Note the following restricted fuctionality for this table:
    - Table contents cannot be transported by specifying key values, at
      best by specifying generic key values with a maximum length of 120
      bytes.
    - The table may not be used as the base table of a lock object.
    (Couple of fields have check tables assigned to them already.)
    Since I want to transport contents of the table also, how to correct this message?
    Ven

    Check this thread..May be useful.
    Warning in SE11 - Defining tables.

  • Powerbook won't start - Disk Utility error "Invalid Key Length" - help plz!

    Hello
    I am having problem with my Titanium powerbook. Since it was refurbished I have only been using it for internet browsing and email and I don't know why it suddenly started freezing. After a couple of freezes it stopped starting up. I don't know why, as I wasn't doing anything unusual. I have run a few checks and don't know how to proceed. Please help.
    This is what I have done so far:
    1. Tried to start up in Safemode. Made the startup sound but then went dead.
    2. I tried Single User Mode and did fsck -fy and the results were:
    ** /dev/rdisk0s10
    ** Root file system
    ** Checking HFS Plus volume
    ** Checking Extents Overflow file.
    ** Checking catalogue file
    Invalid key length
    (4, 135)
    ** volume check failed
    localhost:/ root# Firewire (OHCI) Apple ID 18 built-in: no valid self IDs for more than 2 minutes after bus reset.
    3. No problems were detected by the Hardware Test disk.
    But the powerbook still won't start up properly. I can't get past the blue screen with the 'thinking' (rotating) circle icon (pinwheel?).
    4. When I try to access the computer using a firewire cable the hard disk doesn't appear on the host computer.
    5. I tried Disk repair Utility from startup using a disk but got the same result as with fsck -fy.
    Any ideas?

    Hi, Can't. Your hard drive's directory is damaged in a way that exceeds the limited repair capabilities of Disk Utility or fsck. DiskWarrior can fix "invalid key length" errors, as this short FAQ explains. If you have DiskWarrior, use it to make the repair. If you don't, you can either buy DW, or reformat the hard drive with Disk Utility and start over. Note that reformatting the drive will erase everything on it, so if there's any important, un-backed-up data on it that you can't afford to lose, buying DW will be the better option for you.
    Message was edited by: eww

  • Invalid key length on hard drive. Can this be fixed?

    Hello,
    I have a question about an error I am receiving with a hard drive I have been using for a few months on an imac G3 (the slot loading version). I bought this used 80 GIG hard drive on ebay for a friend of mine and I helped him transfer all his data from his older 9 GIG drive to this newer 80 GIG drive that I bought for him on ebay. I simply cloned the 9 GIG drive onto the new drive using Carbon Copy Cloner. There is not a lot of data on the drive - only about 3 GIGs of data.
    The drive is the only drive in the computer (an imac G3) and therefore it is the startup drive. The operating system on the drive is OS9. All was working fine for a few months until just last week. Now I am receiving this following error:
    error message:
    The disk "Macintosh HD" appears to be damaged. Use a disk repair utility to repair the disk.
    And so I used the disk utility built into OS9 to see if I could repair the problem. (I think OS9's disk utility is called "Disk First Aid")
    When using OS9s disk utility (I think it is called "Disk First Aid") the following report is issued:
    Problem: Invalid key length, 4,943
    Test done. Problems were found but Disk First Aid cannot repair them.
    My questions are:
    What is an "Invalid key length"?
    How serious is this?
    What would cause this?
    Could this have been caused by the physical condition of the disk or possibly by the software on the disk?
    Would re-formatting the drive fix it? (Of course I would try to save any data first onto another disk)
    Or is it risky to continue to use this disk even after reformatting it?
    I guess I have a lot of questions here and if anyone could make any suggestions or comment on why "Invalid key length" errors happen I would really appreciate it. Thanks:)
    Here are some details:
    When I bought the 80 GIG hard drive from ebay the first steps I took were to format the drive using OS9's "drive setup", load the OS9 drivers and then I verifed the disk. The disk seemed to be fine. Then I cloned his old drive onto this 80 GIG drive using Corbon Copy Cloner. I was sure the 80 GIG drive was in a healthy state at that time and I trusted it enough to give it to my friend for his startup drive. Now that the drive has failed with his data and programs, I feel pretty bad. How could this "Invalid key length" error occur?
    Should I go back to the person who sold me the drive on ebay and ask for a refund? Or are "Invalid key length" errors a common occurance with hard drives that should just be accepted? Or might it possibly be the contents (data) on my friend's disk that caused this error.
    It has been suggested to me to use "Tech Tools Pro" or "Disk Warrior" to repair the disk. Hopefully that might repair the disk. Unfortunately these programs are too expensive for this purpose because they would cost more than the computer actually costs (its an old imac G3 computer). I found a service that would run Disk Warrior on the disk to repair it for a $50 fee. Still, that is also not worth it as the computer may not even be worth $50.
    Here are some specifications:
    80 GIG drive specs: SEAGATE BARRACUDA 7200.7 80GB hard drive
    computer: imac G3 (slot loading version)
    OS: Mac OS9
    Thank you for any suggestions especially as to whether I should attempt to return the hard drive or look for a refund for this hard drive or attempt to reformat the drive and try again (backing up the data first).
    I also question the source of all the data on my friends computer. If he had the original operating system disks (which he said didn't come with his computer when he purchased it second-hand), I could have easily re-installed the OS and the applications. But he doesn't have any disks. That serves me right for having to deal with trying to help out someone who has software from a questionable source. I'm never doing that again. I guess that makes me guilty too as an accomplice. I don't feel very good about this
    I didn't know for sure - but I guess I should have assumed his software was illegal if he didn't have the disks - I was afraid to ask. I'm never putting myself in this possibly illegal situation again. Never again will I try to help someone out who doesn't clearly have the legal disks. Please forgive me and everyone else who reads this post. I feel shameful about this but somehow I must get myself out of this problem. I've learned a good lesson. Should I attempt to fix his computer? Or should I tell him to first buy a legal OS and software before I can help him out? You see I feel further guilt because I was the one who gave him the 80 GIG problematic hard drive that failed and I feel I should have to fix it. Can anyone offer me a bit of advice? What do I do?
    What's the right thing to do?

    Thank you Jim and Apple2Freak,
    I appreciate your comments. I am now suggesting to my friend to buy a legal OS and if that is the case I am suggesting to him to move to OSX instead of OS9. Luckily he let me know there wasn't much data on that drive that he needed to save. I am still trying to determine if I could still use this hard drive with the keylength errors if I erase it or if the hard drive has permanent damage. I am hoping that I could install OSX on it and erase the hard drive to start again.
    This imac (slot loading version) can support up to OS 10.3.9 however I might consider Xpostfacto to try to run 10.4. But then I would need to buy 10.3.9 as well as 10.4 and that would double my OS cost. I think I might just look for OS 10.3.9 only. Its not worth it for me to buy two OSes for it.
    Jim, your post was very interesting because it also pointed out that it could be an issue of bad RAM. A few months ago we installed some new second-hand RAM and I wonder if that is the cause of all these problems. I will have to check that first.
    Thanks again!

  • Problem with the field length restrictions in the WSDL file

    Hi all,
    We have created a XSD file where we have defined fields and given some restrictions (like minLength, maxLength) for each field. See below one ex of one element "Id":
    {code     <xs:simpleType name="Id">
              <xs:restriction base="xs:string">
                   <xs:maxLength value="40"/>
              </xs:restriction>
         </xs:simpleType>
    {code}
    Here we have defined maxLength of this field as 40 chars. Our WSDL uses (refers/import) this XSD file and we ganerates java skeleton using RAD. But at runtime if we set more than 40 chars then also it is accepting. It is not throwing an exception. (In the generated java skeletion these restrictions are not reflected antwhere)
    I have one question that, if such restrictions defined in the XSD file works or not? and is it a industry standard to define restriction in the XSD file?
    If yes then what i need to do more to make it working?
    If not then is there any way to do such validation of the fields that are input to the webservice? Or shall i have to just write my own java class to validate each field?
    Regards,
    Ravi

    Or is it possible that we give length restrictions in the XSD (and import this XSD in WSDL) and generate java skeleton from WSDL then the restrictions defined in XSD are mapped into java classes?
    For ex:
    <xs:simpleType name="Id">
        <xs:restriction base="xs:string">
            <xs:maxLength value="40"/>
        </xs:restriction>
    </xs:simpleType>so when in generated java skeleton we set value to "Id" element which is more than 40 charsthen it should throw a exception?
    Is it possible by default or do we need to write custom validation classes to do validations on such fields?
    Has anybody worked in such scenerios?
    Or how to do field validations in webservice? Simple question.
    Thanks In Advance.

  • Dynamic Configuration key length

    I am using dynamic configuration to set certain JMS properties but it appears that the maximum key length is 20 characters.
    Has anyone experienced this problem.  Is this a bug?
    Thanks
    Here is my code
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/JMS", "com_inforecord_messageProcessor");
    conf.put(key1, "SoapMessage");

    Yes, is possible.
    Take a look here:
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=95093307
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/00a7ba12-e7cd-2b10-d589-e52b11346f77

  • How to refer the unlimited key length JCE jar files.

    Hi All,
    The JDK 1.4.2_10 contains the local_policy.jar and US_export_policy.jar that do not permit an unlimited Key length( 64 bit).
    - So I downloaded the unlimited ( Java(TM) Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 1.4.2
    ) https://jsecom15d.sun.com/ECom/EComActionServlet;jsessionid=0F59ACFF95A61F6C0E78B5CE8E0FA93B.
    -Now I want JDK to refer these files without changing anything in existing JDK ( Means I don't want to replcae the existing local_policy.jar , US_export_policy.jar ).
    - Is there any option or property which can tell the JDK to refer the other
    files instead of this location :- C:\bea\WLS8.1SP04\jdk142_05\jre\lib\security.
    Means I want to override these 2 existing files local_policy.jar , US_export_policy.jar without replcaing them.
    Any pointers will be highly appreciated.

    A year later, this is still an issue. No replies ( btw, this is my new login name for the forums ).
    Thank You.

  • Detect key status of '*', '#' & '0' of using getKeyStates() method

    Any know the how to get key status if using getKeyStates() method of GameCanvas object in pressing keys "*", '0' & '#' (as I know, the method just can detect key pressing of number 1~9)? If no, is there any method able to do so (similar function of getKeyStates() but not keyPressed()) or how to modify the method able to function it ?

    Hello,
    Sorry for the confusion... let me try to be more clear...
    So, my test campaign for a specific UUT is composed of about a dozen sequences, which can be run independently. But I created another sequence, to work as a "batch", calling all these dozen sequences.
    Pretty much what it does is:
    1) Call first sequence in new execution
    2) Wait for execution to finish
    3) Check results of execution
    4) Add results to report
    5) Wait 10 seconds
    6) Call second sequence in new execution
    7) So on...
    So, for each new execution, I have a dedicated report, which is exaclty what I want. But for my "batch" sequence, I would like to be able to get a report saying which executions passed or failed, so I don't have to open the reports for each execution individually.
    The way I'm doing this (in step 3 above) is with the following expression:
    ( Find( RunState.PreviousStep.ResultStatus, "Passed", 0, True, False ) >= 0 ) ) ? "Passed" : "Failed"
    This way, anything different than "Passed" would give me a "Failed" result for that execution, and that's fine. The problem is that when one of the executions is terminated before it's finished, the PreviousStep.ResultStatus is giving me "Passed".
    I didn't know about the GetStates() method... Looks promissing! I'll give it a try.

  • Is wpg_docload.download filename length restricted to 78 Characters ?

    All,
    I am using the wpg_docload.download procedure successfully download files. I have encountered a problem when the FILENAME values on the content-disposition attachment tag exceeds 78 characters. Is this a true and limitation of the procedure or have I done something wrong in the construction of my call to the procedure? I have read the threads concerning the upload procedure and noticed filename length restrictions. Do these apply here also ?
    Thanks In Advance,
    Tom
    Edited by: raudabat on Apr 23, 2009 6:38 AM

    Ben,
    Thanks for your reply. My code is very generic in its call to the procedure setting the mime type 'application/pdf' or 'application/ms-excel' and setting the attachment filename parameter. I wouldn't think the results SaveAs filename would have any restrictions in size dealing with directories since it is not allowed to specify the destination directory. My filename is pulled from the database. When I had a filename greater than 78 the wpg_docload function does not do anything or does not raise an error. This really restricts how a user can name there files. I dynamically create PDF and store them into the database using the document title as the filename for the download. However, if I have this limitation, I have to restrict how my user title there documents (or figure how to compress into meaningful titles).
    I have no problem with the download functionality, just the filename length aspect. Hopefully, this can be changed or I will have to live with this limitation. Any insight helpful.
    My site is on a intra-network server.
    Tom

  • OS X Support of Certificate Key Length

    I'm trying to import a self signed root certificate for our enterprise into a Lion machine's key chain and I'm getting an error message: "An error occured. Unable to import "<cert name>" Error -67762"
    The certificate has a key length of 8192 bits, signature algorithm of SHA256RSA.
    The subordiant certificate with a key length of 4096 bits, signature algorithm of SHA256RSA.
    Is there a limitation on the certificate key length that OS X Lion supports? Is this planned to be addressed in an update, or is there a way to change this?

    According to this document:
    https://developer.apple.com/library/mac/#documentation/security/Reference/keycha inservices/Reference/reference.html
    That error value is errSecInvalidAttributeKeyLength
    And I can confirm that the key length of 8192 bits is indeed the issue, as I came across this problem myself from generating a certificate key at that length.

  • Sparseimage Fails Verification with Invalid Key Length error.

    I recently have been having some trouble with my computer. Every time I log out of my account, all of my preferences reset. This just now started happening. It was working fine, then all of a sudden it started to do this. This only happens on my account and doesnt with the root account. On looking up solutions, I discovered that I should verify my home directory image. I logged in as a different user (root) and used disk utility to verify it. However it failed saying "invalid key length" and "Error: The underlying task reported failure on exit". When I try to repair it, it gives me the same error. I backed up my system using superduper to an external drive a while back and verified the sparseimage file that I backed up. It failed with the same error.
    When I verify my harddrive it passes with no problem. Only my sparseimage file is corrupted. I would try diskwarrior but I cant afford it right now.
    Any help would be greatly appreciated. Thanks.
    Macbook   Mac OS X (10.4.9)   100gb hd; 1gb ram; Triple-Boot(OSX-Linux-Vista)

    Would that mean that I can't turn off filevault? Way I see it is that since the image file is corrupted, I would try to have filevault unencrypt it and see if it somehow fixes it. (Since there will be no longer a filevaut image to be corrupted). All of my data in the image file seems to be fine. Everything is still there and I can access everything.
    I was also thinking that I might be able to just copy everything in the image to my external, then deleting the account and create a new one, coping everything back over when im done.
    I know I probably sound like a noob, but im really not. Ive had a lot of experience with my computer, just not this sorta thing. Thanks for your help.

  • Bank Key length configuration

    Hello,
    where can we maintain the bank key length configuration specific to country?
    Thanks,
    Shilpa

    Hi,
    just to clarify my problem,  for a specific country the bank key lenght is set to 5 but i want to enter a bank key with length 7 for this country.
    this data is present in T005 but i am not sure from transaction i change this lenght.
    please help.
    Thanks

  • Maximum index key length exceeded

    Hi,
    I am getting following error on executing this command in MS SQL server 2012-
    Command -
    alter table <table1_name> add constraint <constraint name> foreign key (<column1 name>) references <table2_name>(<column2_name>)
    Error -
    System Error: #1400025: Maximum index key length exceeded
    Warning: #1500562: Index will apply to all business objects
    Any suggestion on what I can check in this case?
    Thanks.

    alter table <table1_name> add constraint <constraint name> foreign key (<column1 name>) references <table2_name>(<column2_name>)
    Error -
    System Error: #1400025: Maximum index key length exceeded
    Warning: #1500562: Index will apply to all business objects
    Any suggestion on what I can check in this case?
    This is not a SQL Server error.  What tool are you using? If you are using SSMS, maybe a DDL trigger? 
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • [b]ORA-01450: maximum key length exceeded[/b]

    Hi I get this error when trying to migrate MS Access 2000 to Oracle. I get this error on foreign key and primary keys saying that the maximum key length has been exceeded.
    What does this mean and how can I fix it? Can anyone help?
    Thanks
    Ray

    Maximum key length also depends on tablespace block size. It seems that your value (1942) may be for 2K blocks.
    At least for my 10.2.0.1.0 on Windoze it takes
    1478 for 2k tablespace
    3118 for 4k tablespace
    6398 for 8k tablespace
    If you have 2K blocks I'd say it is somewhat rather small blocks, I'd normally use 8K blocks.
    So if you have possibility (have at least version 9, probably 9.2 don't know exactly) to create tablespaces with non default blocksize then as a temporal solution you can create tablespace with larger blocksize and create index in it.
    Of course so you have to allocate also some memory for these blocksizes and so divide your memory in possibly less utilized pieces.
    See example for my 8k default blocksize test DB:
    SQL> create table v (a varchar2(4000), b varchar2(4000), c varchar2(4000));
    Table created.
    SQL> insert into v values (lpad('a', 4000, 'a'), null, null);
    1 row created.
    SQL> create index vidx on v (a, b, c);
    create index vidx on v (a, b, c)
    ERROR at line 1:
    ORA-01450: maximum key length (6398) exceeded
    SQL> alter system set db_16k_cache_size = 10240;
    System altered.
    SQL> create tablespace big datafile 'big.dbf' size 10 m blocksize 16k;
    Tablespace created.
    SQL> create index vidx on v (a, b, c) tablespace big;
    Index created.
    Gints Plivna
    http://www.gplivna.eu
    Message was edited by:
    gintsp
    Of course inserting a row was completely unnecessary :)

Maybe you are looking for

  • Acrobat Pro XI isn't detecting a scanner

    I'm running Adobe Acrobat Pro XI on Windows 7 Enterprise SP1 machine.  When I go to File, Create, PDF from Scanner and choose either Color Image or Custom Scan it's not showing any scanners available (custom scan shows "Please Select a Device") if I

  • Planing connection for FR..

    Hi all, I am creting a planning connection in FR to show cell text and supporting details entered, but it is giving me error while creating a planning connection. *"Error connecting to database connection support1: Error: Error getting CSS support in

  • Hidden photos in full screen mode.

    Hey guyz, I think I need a little help here.When I see a photo in the full screen mode and try to navigate through the photos of a specific event using the arrows left n' right I notice that many photos are not shown and are skipped.I can't figure ou

  • Update for PSE 9.0.3 fails repeatedly

    My new Dell Inspiron Laptop came with Printshop Elements 9 preinstalled. I registered the product and now I am trying to update the software. The download was initially large. I keep getting a Patch Cannot be applied  message indicating I should "Con

  • How to view a dvd via airplay

    I'm very surprised that it isn't possible to look a bought dvd via airplay on apple TV. In the shop they told everything what you look on the imac you can mirror via airplay and apple tv on a tvscreen or beamer! But it doesn't work with a simple movi