How to get the public key using modulus and exponent

Dear Sir
I modulo and exp of the public key, how can I combine the GE the full public key, in the host application. These values are coming from the java card?
I get these as follows:
                  rAPDU = channel.transmit(new CommandAPDU(getPublicKeyModCommand));
                  if (rAPDU.getSW() != 0x9000)
                  {  
                       System.out.println("Could not get the modulus");
                  }
                  if (rAPDU.getSW() == 0x9000)
                  {  
                       modulus = new BigInteger(rAPDU.getData());
                       arrayPrint(rAPDU.getData());
                  } 
                  
                  rAPDU = channel.transmit(new CommandAPDU(getPublicKeyExpCommand));
                  if (rAPDU.getSW() != 0x9000)
                  {  
                       System.out.println("Could not get exp");
                  }
                  System.out.println();
                  if (rAPDU.getSW() == 0x9000)
                  {
                       exponent = new BigInteger(rAPDU.getData());
                       arrayPrint(rAPDU.getData());
                  } 

EJP wrote:

In fact, I was using a deprecated function where the problem arose.

N ° with the help of an obsolete method does not cause this problem. In fact:

The stack trace is from this line:

X509Certificate userCert = createClientCert( user_PublicKey, CA_PrivateKey, CA_PublicKey );

The code for this method has not been demonstrated, so he's probably trying to use BC. The factory key code must have worked very well to get to this day.

See you soon,.
Shane

Tags: Java

Similar Questions

  • How to get the public key of a .crt file

    Hello

    I'm new to cryptography, please correct me if I understand well about the digital signature and I need help to get the public key.
    I have a x.crt file that contains the following fields
    (1) x
    (2)
    (3) certificate of

    This certificate contains the following fields
    version of certificate
    owner ID
    name
    public key
    signature (which is obtained by the signature of the beginning of the x.crt public key with the private key)
    now, I need to check if the signature for this I need to get the public key and the signature of the .crt file. Is - this way I need to check the certificate? Please help me because I am a newbie in Cryptography

    You have to look at the Javadoc for BigInteger-

    BigInteger modulus = new BigInteger(1, dataPub);
    

    This will not solve the problem of the module being negative, but I don't think it will solve your problem.

  • How to get the product key I purchased previously?

    How to get the product key I purchased previously?

    Depends entirely on how you bought it in the 1st place.

    A boxed product should have the key on the DVD case, which is the only trace.

    An update Anytime, you should have the key in an e-mail message from Microsoft. If you log in the website to store, you should be able to find the email conversation.

    If another provider such as a key, then you will need to go back to them.

    If your Windows starts now while you can use a keyfinder utility to read the registry key.

  • I have a single open for Exchange 2007 Standard how license get the product key

    I have a single open for Exchange 2007 Standard how license get the product key

    For assistance, please contact the administrator of your Open License program.

  • How to get the string (specified by row and column) of txt file with labview

    Hello world

    How to get the string (specified by row and column) of txt file with labview

    THX

    As far as I know, a text file has no column.  Be more specific.  Do you mean something like the 5th word on line 4, where the words are separated by a space, and lines are separated by a newline character?  You can read from the spreadsheet String function and set the delimiter to a space.  This will produce a 2D channels table.  Then use the table to index and give the line number and column number.

  • How to get the angles of view (horizontal and vertical) camera?

    How to get the angles of view (horizontal and vertical) camera?

    The horizontal and vertical field of VIEW properties are available with the camera_get_physical_property() function.

    Who is using the C API of the photo. I don't think that you can access by using the control of the camera of Cascades.

  • How to get the specific information of hardware and software data center

    How to get the specific information of hardware and software data center with powercli...

    What kind of information you need?

    No matter what Esxi host hardware info., if so could below thread is useful.

    Information about the host material with information on the nic and HBA drivers

  • How to get the public and private keys to use recaptcha?

    I registered with google to get a recaptcha for my Web site. I've gotten has been the key to site and the secret key! If I need to get the public and private key for muse!

    Hello

    Please use the site as a 'public key'key key and Secret as "clΘ privΘe".

    Concerning

    Vivek

  • How to get the primary key of the node selected in af:tree

    Hi all

    I use JDeveloper 11.1.1.5.0.

    I want to get the primary key of the node selected in the af:tree element. I wrote the code below in SelectionListener:
        public void drzewkoRwaSelectionListener(SelectionEvent evt) {
            RichTree tree = (RichTree)evt.getSource();
            TreeModel model = (TreeModel)tree.getValue();
            RowKeySet rowKeySet = evt.getAddedSet();
            Object key = rowKeySet.iterator().next();
            
            model.setRowKey(key);
       
            System.out.println(rowKeySet);
            System.out.println(rowKeySet.size());
    The result looks like this:
    [[oracle.jbo.Key[5 ], oracle.jbo.Key[6 ], oracle.jbo.Key[12 ],oracle.jbo.Key[14 ]]]]
    1
    I need the values of the last 2 nodes:
    1: oracle.jbo.Key [14]
    2: oracle.jbo.Key [12]

    How can I get?

    Kind regards
    Wojtek.

    Hello

    Try this code:

    {} public void drzewkoRwaSelectionListener (evt SelectionEvent)
    RichTree tree = (RichTree) evt.getSource ();
    Model TreeModel (TreeModel) = tree.getValue ();
    RowKeySet rowKeySet = evt.getAddedSet ();
    Key of the object = rowKeySet.iterator () .next ();

    model.setRowKey (key);

    System.out.println (rowKeySet);
    System.out.println (rowKeySet.Size ());

    Object [] keys = rowKeySet.toArray ();
    List (list) = keys [0];
    Keys = list.toArray ();
    * //from the table keys, you can get according to the value you want using as: [2], [3] key *.

  • How to get the product key from old computer running XP SP1 until she is thrown?

    How can I get my registration code from my old computer with xp with service pack 1 before I throw it away

    * original title - how can I get my registration key of xp to xp I can see all the files in my computer *.

    Hello

    You can get the product key of your Windows XP CD. To get the key from your computer, you might have to look by using a third party app that could help you achieve the same.

    Please use your favorite search engine and browse for such a program that is used to.

    Note:  This response contains a reference to third party World Wide Web site. Microsoft provides this information as a convenience to you. Microsoft does not control these sites and no has not tested any software or information found on these sites; Therefore, Microsoft cannot make any approach to quality, security or the ability of a software or information that are there. There are the dangers inherent in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

  • How to get the mode keys in Potrait of BB 9530 Simulator

    Hello

    Please tell me how we can get all the keys in the event of BB 9530 Simulator potrait mode. I use the keyChar function to get the Keyboard Keys.When I try Simulator I get only first character printed on the key on the keyboard. For example if QW printed on the key on the keyboard I am only able to do Q.

    Hello

    To get both the character press a single button, you need to implement your own logic to exploit it is to say you need to keep track of the frequency to which the user has press a particular button, if it is continuously pressing a particular key must move this key.

    You can use keyRepeat() etc functions to achieve this.

    Please let me know if it helped you or not.

  • How to export the public key / certificate of OUD?

    Hi all

    Maybe it's to export the public key of a unified directory of Oracle?

    I.e. I have Setup SSL on port 636.

    I had created a new certificate self-signed and added to the LDAP server following the guide of SSL to get up and running fast - Oracle Fusion Middleware Oracle Administration Guide unified directory.

    But the certificate for the LDAP server sends when the connection to this is some other certificate and not my certificate.

    CN = computer name, O = Oracle unified the self-signed certificate directory

    Instead of

    CN = Company.com, o = company, c is AU

    that I had created. Because when I created this certificate I exported public key in a text file as per step 4.

    Any guidance would be great.

    Hello

    You want to assign a new SSL certificate to the OUD instance or you just want to export the existing one so that you can import it into a truststore customer?

    To export the cert public key OUD, follow these steps:

    JAVA_HOME/bin/keytool - export - keystore /OUD/config/keystore-alias server-cert-file mycert.cer

    You will be asked the password store which is located in OUD_INSTANCE_DIR>/OUD/config/keystore.pin

    -Sylvain

    ------

    When closing a thread as answered don't forget to mark the messages correct and useful to make it easier for others to find their

  • How to get the activation key

    I bought a copy of download of Lightroom 5 from a legitimate source and was delivered with a product key that contains 22 digits, grouped into 6, 4, 4, 4, 4. However, the activation key for the software requires 24 digits into 6 groups of 4. How can I get the correct key?

    Using redemption code

    Mylenium

  • Satellite A210-14 t: how to get the Fn keys to work under XP?

    Anyone has a solution how can I get the 'Fn' - key to work under Windows XP?

    Will there be a version of the Windows XP drivers in the near future?

    Thank you

    I imagine that you will not be able to get the keys FN works on XP because the XP drivers are not available at this time.
    Seems that you have to wait and hope ;)

  • How to get the license key for VC?

    My company just bought 4 x 2 p license Sw from HP and all I received are 4 record/partner activation code separates.

    I have read the document and the code is to download the software and I don't know how I can get the license key to turn in the VC. (I know how to install a VC2.5 license key)

    Any suggestion please.

    Thank you

    The existing process for redeemding a partner activation code is still in place, please review the KB:

    http://KB.VMware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=1003303&sliceId=1&docTypeID=DT_KB_1_1&dialogID=22908232&StateID=0%200%2022592660

    ESG-VMware

    VMware communities user moderator

Maybe you are looking for