Results 1 to 6 of 6
  1. #1
    bobo67 is offline Member
    Join Date
    Sep 2010
    Posts
    37
    Rep Power
    0

    Unhappy convert private key to bigInteger

    hi
    how to convert private key to BigInteger?
    regards,

  2. #2
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    757
    Rep Power
    7

    Default

    Hello,

    What do you mean by private key?

  3. #3
    bobo67 is offline Member
    Join Date
    Sep 2010
    Posts
    37
    Rep Power
    0

    Default

    I have to convert privatek to bigInteger:

    PrivateKey privatek = ( PrivateKey)keypair.getCryptoBag(CryptoBag.V_KEY_PR IVATE);

  4. #4
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    757
    Rep Power
    7

    Default

    What part of the PrivateKey do you want to convert to BigInteger. From what I look at the API the PrivateKey is just an interface that doesn't have any method. Do you want to convert encoded value of the key into BigInteger?

    Is this what you want:

    Java Code:
    PrivateKey key = ...;
    BigInteger value = new BigInteger(key.getEncoded());
    Last edited by wsaryada; 09-02-2010 at 02:32 PM.

  5. #5
    bobo67 is offline Member
    Join Date
    Sep 2010
    Posts
    37
    Rep Power
    0

    Default

    I have an equation in which a is DSA private key.
    my equation is: x^a mod p
    if I can convert it to BigIngter, It will be like this:
    x.modpow(a,p);

  6. #6
    bobo67 is offline Member
    Join Date
    Sep 2010
    Posts
    37
    Rep Power
    0

Similar Threads

  1. How to convert a string into a BigInteger
    By valery in forum New To Java
    Replies: 4
    Last Post: 09-13-2011, 01:32 PM
  2. convert BigInteger
    By bobo67 in forum New To Java
    Replies: 1
    Last Post: 09-01-2010, 02:00 PM
  3. BigInteger
    By windows.login in forum New To Java
    Replies: 8
    Last Post: 07-13-2010, 01:10 PM
  4. Replies: 7
    Last Post: 06-28-2010, 07:52 AM
  5. how to convert from BigInteger to Hex
    By nanaji in forum Advanced Java
    Replies: 10
    Last Post: 05-22-2008, 12:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •