Problem generating Key  with keytool command

Hi Everyone;
I'm having problems generating a key.
Here's my output.
C:\>keytool -genkey -alias learningIdeas -keysize 1024 -validity 365 -keyalg RSA
Enter keystore password: changeit
keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect
note i already did something with the keystore such that i have generated a key and placed this in server.xml
<Connector className="org.apache.tomcat.service.PoolTcpConnector">
<Parameter name="handler" value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
<Parameter name="port" value="8443"/>
<Parameter name="socketFactory" value="org.apache.tomcat.net.SSLSocketFactory" />
     <Parameter name="keystore" value="C:/stephen" />
     <Parameter name="keypass" value="changeit"/>
     <Parameter name="clientAuth" value="false"/>
</Connector>
any ideas on what I can do to generate this key?
stephen

I have almost resolved this problem. I'm at the last step and getting an error message when trying to import the certificate that I received from verisign into my keystore.
here's my error.
C:\>keytool -import -alias mycompanyname123 -keystore STEPHEN4 -file mycompanyname.cer
Enter keystore password: changeit
keytool error: java.security.cert.CertificateException: Unsupported encoding
but when I double click on this file mycompanyname.cer (which is exactly what I received from verisign, up comes the appropriate certificate
i was able to succesfully able to install it into the microsoft browser and i see it correctly represented and displayed in the certificates section for OTHER PEOPLE.
But I think i have to successfully import it into the keystore for it to work properly right when I start up the tomcaat app is that correct?
any ideas?
Stephen

Similar Messages

  • Failure to generate key with keytool

    I tried to use keytool to generate a key on Linux. It was successful on other Linux machines, but it is strange that it is failure on my production server.
    # /usr/java/jdk/bin/keytool -genkey -v -alias test2 -keyalg RSA
    Enter keystore password: changeit
    What is your first and last name?
    [Unknown]:
    What is the name of your organizational unit?
    [Unknown]:
    What is the name of your organization?
    [Unknown]:
    What is the name of your City or Locality?
    [Unknown]:
    What is the name of your State or Province?
    [Unknown]:
    What is the two-letter country code for this unit?
    [Unknown]:
    Is CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct?
    [no]: yes
    Generating 1,024 bit RSA key pair and self-signed certificate (MD5WithRSA)
    for: CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown
    And then the keytool keeps running but cannot generate a key.
    My production server is:
    - Intel Pentinum III 850 with 256MB RAM
    - RedHat Linux 7.2
    - Java 2 SDK build 1.4.0-beta3-b84
    Remark: I tried with same version of Linux distro and Java SDK on other machine, but it was successful.

    Chances are it is hung on the SecureRandom's use of the /dev/random
    device. If I recall right the proper /dev/random on linux is really
    /dev/urandom. So what you need to do is edit the
    <java_home>/jre/lib/security/java.security file a change the property
    to /dev/urandom instead of its default /dev/random value.....

  • Finding generated keys with batch updates

    Is it possible to combine reading generated keys with batch updates?
    In trying to improve performance of inserts into a database, I am using the addBatch functionality of the JDBC driver to insert several rows at once. Unfortunately some of my tables have auto numbered fields and I need to know what values they are taking so I can update my in-memory representation of the object in the database.
    The getGeneratedKeys functionality works fine when I insert one row at a time, but when I try to insert a batch of rows, the method returns null.
    I am using DB2 with the com.ibm.db2.jcc driver, though I have a hunch that this is a limitation of the JDBC spec. Can anyone confirm this? Does anyone have any ideas about a workaround?

    What is "several"?
    And have you actually measured the speed difference?
    Since returning generated keys is a rather recent addition to JDBC I doubt that it exists for batch updates.

  • Problem true/false with the command SHOW_LOV

    Hello,
    I have a simple problem with the command SHOW_LOL
    When i press an Button with this trigger:
    LIST_OF_VALUES('hallo','OKI');
    And my Procedire like this:
    PROCEDURE list_of_values(p_lov in VARCHAR2, p_text in VARCHAR2) IS
    v_lov BOOLEAN;
    BEGIN
    v_lov := SHOW_LOV(p_lov);
    IF v_lov THEN
    MESSAGE('You have just selected a '||p_text);
    ELSE
    MESSAGE('You have just cancelled the List of Values');
    END IF;
    END;
    When ever i pressed the button, the procedure jumps into the else sector, but why?
    Because it is true, or not?
    When i alter the variable like this:
    v_lov := true;
    then it runs.
    Can you help me?
    Greetings

    example of help forms 6i.
    DECLARE
    a_value_chosen BOOLEAN;
    BEGIN
    a_value_chosen := Show_Lov('my_employee_status_lov');
    IF NOT a_value_chosen THEN
    Message('You have not selected a value.');
    Bell;
    RAISE Form_Trigger_Failure;
    END IF;
    END;

  • Problem generating index with 2th level in cs4

    Windows XP sp 3 - Indesign CS4 601
    When generating an index with a 1st and a 2th level, in the 2th level the entry of the 1st entry is always repeated.
    E.g. the index should look as this:
    text     75
         capitalized     76
         import     78
    word     105
         language     108
         meaning     109
    But actually the index looks as this:   
    text     75
         textcapitalized     76
         textimport     78
    word     105
         wordlanguage     108
         wordmeaning     109
    Is this a bug, or is there a solution for it?
    Thanks for your help!
    Luc Van de Cruys
    phaedra creative communications

    Oops!
    Just tested the script.
    I run it, and I get the script alert 'All Done' at the end.
    But nothing happens.
    This is what I do:
    - I generate the index.
    - I select the index with the text tool (select all or just put the textcursor somewhere in the index makes no difference).
    - I run the script
    - I get the message 'all done', but there is no difference. The problem persists.
    Any other ideas?
    Thanks anyway.
    L.L.

  • Problems generating classes with JAXB

    Does anyone know where there might be a list of known problems with generating classes from an xsd with JAXB? I have a very deep and pretty complicated xsd, and it seems some elements get generated correctly and some don't. It's very hard to find any pattern of why. Is there a limit to the number of levels deep it will go?

    Try here as well
    https://jaxb.dev.java.net/

  • How to use the bootp_enabled key with dscl command create

    During Netboot service configuration I wanted to do it right and followed the suggestions in "System Imaging and Software Update Administration" (page 22):
    +"To prevent the NetBoot BootP server from responding to+
    +requests for IP addresses, use the dscl command-line tool to open the local folder on the NetBoot server and add a key named bootp_enabled with no value to the /config/dhcp/ folder."+
    so I first tried to read the local directory:
    xadmin$ *sudo dscl . -read /config/dhcp/*
    AppleMetaNodeLocation: /Local/Default
    RecordName: dhcp
    RecordType: dsRecTypeNative:config
    and then to create the key:
    xadmin$ *sudo dscl . -create /config/dhcp/ bootp_enabled*
    * Uncaught Exception: <NSInvalidArgumentException> ([DSoDataNode initWithDir:value:] value is not a valid NSString nor NSData)
    but did not succeed. Somthing must be wrong with the syntax. Tried several (Config, dhcp noslash, bootp_enabled:) but nothing helped.
    You dscl experts - please enlighten me!
    Btw. Apple why not include to correkt syntax in a manual?

    worked for me, too
    Thanks a lot,
    Willi

  • Problem generating Proxy with Server Explorer

    Hi,
    i've tried too generate a SAPProxy with .net Connector 2.0.
    When i drag the desired function from the Server Explorer to the designer i've got following error message:
    "Server Explorer: The system could not find the specified file."
    What can cause this error and how can a solve this problem?
    regards
    guenther

    Hi Reiner,
    thanx for your help! it works great now!
    regards
    guenther

  • SNRO generate key with SM30

    I have a Ztable where I want to use an unique index key which I have maintained by SNRO.
    Is it possible to combine this with the data maintenance in SM30 so that I don't have to fill in the key myself but that it just takes the next one if I want to add a new record with SM30 ??
    (ps perhaps a really stupid question but I can't figure out how I can search on SNRO AND SM30 in sdn ? so it was impossible for me to find if this question was already asked before how can you use the "and" function in sdn ? )

    Hi,
    Try this..
    You can use the event 05 "Creating a new entry" and in the subroutine you can call NUMBER_GET_NEXT to get the next number and move it to the key field...
    Check this example..
    Create an entry in the view TVIMF with your table name..event 05 and subroutine GET_NUMBER_NEXT.
    FORM GET_NUMBER_NEXT.
    Types Declaration
      TYPES: BEGIN OF ztable_wa.
              INCLUDE STRUCTURE ztable.
      TYPES:  update_fl TYPE char1,
              mark      TYPE char1,
             END OF ztable_wa.
    Workarea Declaration
      DATA: wa TYPE ztable_wa.
    Assign the current workarea
        wa = <table1>.
    Call the function module
       CALL FUNCTION 'NUMBER_GET_NEXT'
    Assign the value.
        wa-key_field1 = 'Value got from the FM'.
    ENDFORM.
    Thanks,
    Naren

  • Read PKCS8 encrypted key with Triple DES

    Hi, I have a RSA private key in a PKCS8 file, encrypted with Triple DES. I can obtain the RSA private key with the command:
    openssl pkcs8 -inform der -v2 des3 -passin pass:mypass -in private.key > rsakey.key
    Then I can read it in Java using bouncycastle classes:
                    Security.addProvider(new BouncyCastleProvider());
              String file = "rsakey.key";
              PEMReader pr = new PEMReader(new FileReader(file));
              Object obj = pr.readObject();
              KeyPair kp = (KeyPair) obj;
              PrivateKey privateKey = kp.getPrivate();My question is:
    How can I use the bouncycastle classes to replace the openssl command, So all the process stays in java.
    Thanks in advance
    Rich

    The class for this is javax.crypto.EncryptedPrivateKeyInfo but I seem to be having trouble getting it to work (I've posted about my problem in the Cryptography forum).

  • Number 2 key(with "at" symbol) is not working......

    Hi,
    i am using HP 15-d006tu Notebook PC with windows 8 os.
    Recently i started facing a serious problem ie key with numer 2 and at symbol is not working. my model is having numeric keypad so i can type 2 with that but i am not able to type at symbol. Finding it really hard to copy paste the email addresses or the symbol alone. i checked whether it is jammed or something like that but nothing is there and its pressing like anyother key but when i press that key nothing is happening. 
    kindly let me know whether it is a hardware issue or some virus or something like that????
    Should i take my device to the service center and change the entire keypad???
    Really finding this problem a big headache. Its not even 1 year since i bought this laptop.
    Please please guide me.....
    Thank in advance
    Jobin 

    Hi
    Did you try connecting to USB keyboard and check?
    Shut down the notebook
    unplug the AC Adapter
    Disconnect all the external peripheral devices
    then remove the battery
    Hold down the Power button for 30 seconds
    Re-insert the battery and plug in the AC Adapter
    Tap away at the ESC key as you start the notebook to see if this will launch the Start-up Menu
    then select F10 to enter the bios menu
    Press F5 to load the defaults ( this is sometimes F9, but the menu at the bottom will show the correct key )
    use the arrow keys ( assuming they work in this menu ) to select 'Yes' and hit enter
    Press F10 to save the setting and again use the arrow keys to select 'Yes' and hit enter.
    If that doesn't resolve the problem, then it's probably hardware issue,
    You can confirm it by testing keyboard from BIOS:
    http://h10025.www1.hp.com/ewfrf/wc/document?cc=us&lc=en&docname=c03467259
    Contact HP in your region:
    http://www8.hp.com/us/en/contact-hp/ww-contact-us.html
    Regards,
    ++Please click KUDOS / White thumb to say thanks
    ++Please click ACCEPT AS SOLUTION to help others, find this solution faster
    **I'm a Volunteer, I do not work for HP**

  • The problem I have since I upgraded to Mavericks version 10.9.1 The problem appears only with Mail not with other programs, not even with my browser. When I try to zoom the text of an e-mail I received or sent , I can no longer use the keys Command   to e

    the problem I have since I upgraded to Mavericks version 10.9.1
    The problem appears only with Mail not with other programs, not even with my browser.
    When I try to zoom the text of an e-mail I received or sent , I can no longer use the keys Command + to enlarge the text, although I can reduce it with Command -.
    As I have a problem with my eyes, This is a serious matter for me.
    When I write an e-mail, if I select text and press Command +, it just displaces the text to the right.
    Now, my husband has a USB keyboard. If he connects it to my computer, his regular Command + does not work either, but  he uses the extended keyboard, then it works. Unfortunately, he needs it for a musical application which does not work with a wireless keyboard.

    Firefox 3.6.4 and 3.6.6 use a process called, "plugin-container.exe" which was using up most of my CPU when I opened up multiple tabs that contained Adobe Flash files, and caused Firefox to lock up.
    My solution was to use Firefox 3.5.10 which you can get from the Mozilla website at [http://www.mozilla.com/en-US/firefox/all-older.html]
    I am using Adobe Flash 10.1.53.64 without any problem in this version of Firefox. Check the release notes, I believe it contains all the latest security fixes in "Firefox 3.6.4".
    Hopefully, they will fix Firefox 3.6 in the next version (e.g. Firefox 3.6.7), until then you should probably use "Firefox 3.5.10".

  • Problem generating Web Service with business methods in multiple EJB's

    Hi,
    I'm I a "web service novice" but I'm working with an
    application which was developed in an earlier version
    of Studio which has
    ~30 business method coming from ~12 EJB's. When I attempt
    to recreate the Web Service in Java Studio Enterprise 7 (had same problem versions 5 and 6) I have trouble. When I execute the "Generate Web Service Files" command I get complilation errors in the <webservice_name>.java file. It is obvious that the
    protected Map theJNDIMap = makeJNDIMap();
    protected Map makeJNDIMap() {
         Map m = new HashMap();
         // This map might get changed at deployment time
         m.put(......
    is all screwed up. Entries are missing and the closing bracket isn't even there.
    Is there some user error on my part?
    Is this a know bug (I couldn't any info. and I get the same behavior on the current and older versions of Studio)?
    Is there a workaround? I can fix this particular java file and compile it sucessfully. However, I'm still missing many of the other web service files that should be generated for me.
    All the tutorials on web services that I've done to looked over all get there business method from 1 EJB :(
    Please advise,
    Freda Phelps

    I had a problem too. Successfully created an EJB and its test application. Tested the same using Web client and works fine. Now created a web service from EJB methods. It created the skeletons. When tried creating Web Svc test client or web svc other files..it gives me an exception saying xmlservices.jar doesnt exist in the C:\Docs and Settings\<$username>\.jstudio\Ent04Q4modules. I have searched for this file and copied (overwritten) it into this directory. But still i cant proceed further.

  • Prioryly generated key problem.

    public String encrypt(String password){
    String algo = "DESede";
    Cipher cipher = Cipher.getInstance(algo);
    String s = null;
    Key key = (Key)com.sun.crypto.provider.DESedeKey@4f9655f1;
    cipher.init(Cipher.ENCRYPT_MODE, key);
         byte[] inputBytes = password.getBytes();
         s = cipher.doFinal(inputBytes);
    return s;
    public String decrypt(String password){
    String algo = "DESede";
    Cipher cipher = Cipher.getInstance(algo);
    String s = null;
    Key key = (Key)com.sun.crypto.provider.DESedeKey@4f9655f1;
    cipher.init(Cipher.DECRYPT_MODE, key);
         byte[] vas = cipher.doFinal(password);
         String s = new String(vas);
         return s;
    I got a problem with the above code the character @ in the object com.sun.crypto.provider.DESedeKey@4f9655f1 does not compile in java, but I need to use it because its my pre generated key that i wish to use in encryption and decryption function.
    Thanks for the help in advance.

    Wow. This one is...surreal. Let's see:
    As silk.m noted, what you're trying to do doesn't make any sense. You need to have the bytes of the Key in order to recreate it. Use generatedKey.getEncoded() to get the byte[] that describes the Key, and then look at how to use DESedeKeySpec and SecretKeyFactory to recreate the Key object.
    On top of that, you have other problems.
    You can't just use byte[] plaintext = s.getBytes(). The default String encoding is different on different platforms. You need to tell getBytes() which encoding you really want.
    You're attempting to return the output of doFinal() as a String. You can't - it's a byte[]. You can't just return "new String(doFinalBytes)", either - ciphertext IS NOT "String-able". You'll need to Base64 it first.
    It's also possible you'll be bitten by having a plaintext that isn't an integral number of blocks. I don't recall if the default DESede uses padding, or assumes NoPadding.
    You've got some fixing to do...
    Good luck,
    Grant

  • Generating symmetric key with RSA

    Hello,
    I have a problem. I want to generate symmetric keys with the use of RSA. But RSA is not supported by Java 1.4.2 except for the signature class.
    My question is can I generate symmetric keys using RSA and Bouncy Castle provider??? Or is there a way around ???
    Thanks a lot,
    Ravi

    Or write your own RSA. here is some working code:
    ///////////////// class BigIntegerRSA /////////////////
    import java.math.*;
    import java.util.*;
    public class BigIntegerRSA {
      int bits;
      BigInteger p, q, n, nPrime, e, d;
      public BigIntegerRSA(int _bits, BigInteger _p, BigInteger _q) {
        bits=_bits;
        p=_p;
        q=_q;
        n = p.multiply(q);
        nPrime = p.subtract(BigInteger.ONE).multiply( q.subtract(BigInteger.ONE));
        e=BigInteger.ZERO;
        BigInteger TEN=new BigInteger(""+10);
        for( e = nPrime.divide(TEN); !BigIntegerUtil.gcd( e, nPrime ).equals(BigInteger.ONE); e=e.add(BigInteger.ONE)){
        d = BigIntegerUtil.inverse( e, nPrime );
      public static BigIntegerRSA generate(int _bits) {
        BigIntegerRSA rsa= null;
        boolean verified=false;
        while(!verified){
          BigInteger p=BigInteger.probablePrime(_bits/2+1,new Random(System.currentTimeMillis()));
          BigInteger q=BigInteger.probablePrime(_bits/2+1,new Random(System.currentTimeMillis()));
          rsa= new BigIntegerRSA(_bits,p,q);
          verified= rsa.verify();
        return rsa;
      public BigIntegerRSAPublicKey getPublicKey(){
        return new BigIntegerRSAPublicKey(bits,e,n);
      public BigIntegerRSAPrivateKey getPrivateKey(){
        return new BigIntegerRSAPrivateKey(bits,d,n);
      public boolean verify() {
        //e * d % ( nPrime ) == 1
        BigInteger multiplied=e.multiply(d).mod(nPrime);
        if(!multiplied.equals(BigInteger.ONE)){
          return false;
        //test random
        BigIntegerRSAPublicKey pub=getPublicKey();
        BigIntegerRSAPrivateKey priv=getPrivateKey();
        BigInteger message, encoded, decoded;
        //random
        message=new BigInteger(bits-2, new Random(System.currentTimeMillis()));
        encoded=pub.code(message);
        decoded=priv.decode(encoded);
        if(!message.equals(decoded)){
          System.out.println("Failed to encode and decode "+message);
          return false;
        return true;
      public static void main( String [ ] args ){
        BigIntegerRSA rsa=BigIntegerRSA.generate(512);
        BigIntegerRSAPublicKey pub=rsa.getPublicKey();
        BigIntegerRSAPrivateKey priv=rsa.getPrivateKey();
        BigInteger message=new BigInteger("2938798723423429020");
        System.out.println( "message: " + message );
        BigInteger code = pub.code(message);
        BigInteger decode = priv.decode(code);
        System.out.println( "Code: " + code );
        System.out.println( "Decode: " + decode );
    ///////////////// class BigIntegerRSAPublicKey /////////////////
    import java.math.*;
    import java.util.*;
    public class BigIntegerRSAPublicKey{
      int bits;
      BigInteger e,n;
      public BigIntegerRSAPublicKey(int _bits, BigInteger _e, BigInteger _n) {
        bits=_bits;
        e=_e;
        n=_n;
      public BigInteger code(BigInteger message) {
        if(message.bitLength()>bits){
          return null;//"Cannot encode anything with more bits than bits while message had message.bitLength() bits
        return message.modPow(e,n);
    ///////////////// class BigIntegerRSAPrivateKey /////////////////
    import java.math.*;
    import java.util.*;
    public class BigIntegerRSAPrivateKey {
      int bits;
      BigInteger d, n;
      public BigIntegerRSAPrivateKey(int _bits, BigInteger _d, BigInteger _n) {
        bits=_bits;
        d=_d;
        n=_n;
      public BigInteger decode(BigInteger code)  {
        if(code.compareTo(n)>0){
          return null;//Cannot decode anything greater than n while code was code
        return code.modPow(d,n);
    ///////////////// class BigIntegerUtil /////////////////
    import java.math.*;
    import java.util.*;
    public class BigIntegerUtil {
      // Internal variables for fullGcd
      private static BigInteger x;
      private static BigInteger y;
      public static BigInteger gcd( BigInteger a, BigInteger b )
        if( b.equals(BigInteger.ZERO) )
          return a;
        else
          return gcd( b, a.mod(b) );
      public static BigInteger inverse( BigInteger a, BigInteger n )
        fullGcd( a, n );
        return x.compareTo(BigInteger.ZERO)>0 ? x : x.add(n);
      private static void fullGcd( BigInteger a, BigInteger b )
        BigInteger x1, y1;
        if( b.equals(BigInteger.ZERO) )
          x = BigInteger.ONE;
          y = BigInteger.ZERO;
        else
          fullGcd( b, a.mod(b) );
          x1 = x; y1 = y;
          x = y1;
          y = x1.subtract(( a.divide(b) ).multiply(y1));
    }And since BigInteger has the methods .toByteArray() and new BigInteger(byte[] b) this is perfect for encrypting and decrypting anything, eg a DES key or some other symmetric encryption

Maybe you are looking for

  • Uploading data from Legacy System to SAP (In PS Module)

    While Implementing Project system Module, Whether LSMW is applicable for uploading data from Legacy sytem. If not, then what is the method used for uploading the data from Legacy sytsem to SAP

  • Module pool F4-Help problem for a field in custom Infotype(HR).

    Dear Gurus, I have created a custom Infotype and fields are like P9015-NAM01. P9015-NAM02. P9015-NAM03. all are fields for name. I want F4 help for these fields with values same as  Family Members-First name  given in 21 Infotype . for all 3 fields s

  • Itunes opens with Just Text but no grapic interface

    I open Itunes and it opens with No GUI jus tthe text .. song names and the text menu bar but no grpahical interface.. its like it is invisable... any ideas please le tme know if you need more info Its a Dell xps 400 and 1g memory ati 128M x300 video

  • No XML Messeges generation in SRM

    Dear Experts, I am working on SRM-SUS scenarion on SRM Server 7.0, I have correctly configured XI  ESOA Scenario  and also transferred vendors from SRM to SUS through SupplierPortalTradingPartner_CreateOrChange_Out messege type but PurchaseOrderReque

  • How to find the client number of xMII server i m running

    Hi experts, Here i am simply providing the URL in my browser and it shows the login page of xMII server.But i want to find under which client i am currently running this xMII ,how can i find that client number? Thanks , S.Ramesh Kumar.