Sending publickey through the network as a byte array.

I send client public key form server to client as a byte array through the network. I'm sruggling when I get that byte array from client side and again assign to the PublicKey variable. Anyone can give me any hints how can I extract the public key from the byte array.
Thank you

If your public key is from an X509 certificate, you can use the X509EncodedKeySpec class.

Similar Messages

  • Sending data to the card in a byte array

    I am trying to store a variable dataCI[] with the data that comes into the buffer. I send this:
    /send 0003000A0102030405
    (INS=03)
    Afterwards I want dataCI[] to have this value= "0102030405"
    Here is my code. But when I am sending the bytes, it gives me an error of wrong length and does not matter how many bytes I send :/
    DATA_LENGTH = 10;
    lDate= apdu.setIncomingAndReceive();
    if(lDate != DATA_LENGTH){
    ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
    Util.arrayCopy(buffer, ISO7816.OFFSET_CDATA, dataCI, (short) 0, lDate);
    return;
    Also I tried with (lDate > DATA_LENGTH) and (lDate < DATA_LENGTH) but nothing works, it always gives me the error of wrong_length.
    Can anybody tell me what am I doing wrong????                

    Let's break down your apdu command....
    "send 0003000A0102030405"
    We agree that you are sending 5 bytes, so your Lc should = 5 not 0a
    CLA = 00
    INS = 03
    P1 = 00
    P2 = 0A <-- This should be your Lc !
    Lc = 01 <--- This says there is 1 byte of data
    CData = 02
    Le = 03 <- This states there is 3 bytes coming back.
    Lost in la la land data 04 05
    So your command should read...
    00 03 00 00 05 01 02 03 04 05;

  • Send huge data through the network

    Hi all,
    I need to transfer large image (around 200MB) through the network to the neighborhood PCs for processing. The time i have is very short (Say 4 seconds).
    Since, i need to send the image to multiple PCs, i thought UDP will be helpful. But the LabVIEW UDP vis having limitation of 548 bytes reading for each run. So i need to run in a loop and get the image. Building the string also will be of great memory related task. So the time taken is very high (in the order of minutes). often, i am missing some of the bytes during the operation.
    Then i have tried TCP/IP, planning to send to only one PC. There also when the size is more than 78MB, i am not able to send in single time. Is it so? But i have not seen any limitations in the documents. For 78 MB it take around 18 seconds. But the data is safe.
    The great disadvantage of these two method is, i need to flatten as a string and and rebuild the image in the other end.
    I have tried one more option also, using save as bmp, and read from the network. This work quite better compared to the other two. Time take to transfer 200MB image is 24 seconds ( 5 seconds to save in the same PC + 19 seconds to read through the network). Still it is far from my requirement. One advantage here is, i can read as image datatype it self.
    I have used 100Mps LAN, yes, i can go far 1GPS. Then any other idea how to transfer these huge files in quick manner.
    Thanks,
    Logic

    Hi cc,
    Yes, i was quite clear on that. The point i want to explain is - because of the limitation of the VIs (like 548 bytes for UDP & 78MB for TCP/IP) we are not able to achieve this.
    I need to flatten to string the 200MB image.
    I need to send this in a loop (loop delay may needed to synchronize)
    I need to concatenate at the other end
    Unflatten to image
    Look at the timing i have send in my last mail. Its huge for UDP & TCP/IP
    But the File I/O looks simple and comes closer to your calculation. In my trial i have sent 180 Mega byte image - it took 19 seconds to read from the network PC Harddisk in 100mbps line - which looks good. In a way File I/O also, should do the same (Flatten - read thru network -May be in an ideal way). Anyway, I have left with 2 questions now.
    In File I/O, i need to first write image in to Harddisk of the same PC - that time going to remain the same, any ideas on reducing this? Any chance for without saving into HD - transfer?
    Will it reduce directly 10 times if i go for 1Gbps? (200MB in 2 Secs?) Anything else decides this timing?
    Thanks,
    logic

  • Does ODBC encrypts data while passing through the network?

    Does ODBC encrypts data while passing through the network?

    ODBC uses the underlying Oracle networking components to transmit data. By default, these components do not encrypt data, although they can be made to do so-- see the "SSL Encryption" thread from a few days ago.
    Justin

  • Backup my external hard drives through the network.

    I have a small network at the house. Three computers hooked up to the airport extreme router. Then I have a usb hub connected to the input of the router. To the hub I have 4 external Maxtor 1tb hard drives. Everything works beautifully.
    I would like to have two of the external hard drives back up the other two externals.
    I tried time machine, special software, Maxtor sync manager nothing works.

    I'm having similar issues to that. I have a Maxtor 500GB external drive that I would like to be able to attach to my Airport Extreme and access it that way. I am part of a three computer home network, but I'm the only one running Leopard, and I want the other two computers to be able to use the drive for simple drag and drop backup, rather than TM. However, after much searching, I haven't really got anywhere in figuring out how to set it up. How did you set up your drives going through the network?

  • I installed Mavericks and now I can't print to my brother HL-2040 through the network

    I installed Mavericks and now I can't print to my brother HL-2040 through the network, it does not see the printer

    Here's the link to that article:
    http://support.apple.com/kb/PH11143
    However it has not been updated to refelct if it works with Mavericks

  • TS3276 I am unable to access mail on icloud or send mail through the icloud account.  How can I get mail routed through the icloud account.

    I am unable to access mail on icloud or send mail through the icloud

    Here is how to set up your iCloud email account:
    http://www.apple.com/support/macosx/mailassistant/

  • What app can you download that will allow wifi calling when you have no cell signal through the network?

    What app can you download that will allow wifi calling when you have no cell signal through the network?

    You might Give this App a Try..  I have not use this my-self but have Look through the Link see what you think..
    Talkatone free calls + texting - Android Apps on Google Play
    Here's some Extra Info I found through C|Net on the app you were asking about
    3 Android apps for Wi-Fi calling with Google Voice - CNET

  • Printing through the network

    I have heard the I can print through my wireless network. Just where do I have to go and what do I have to do to get that going ? I want to be able to print to a printer upstairs from a pc downstairs. The pecee recieves a signal from my wreless router by my macpro.
    thanks

    This whole thing began when I asked the tech at school if he had ever used a bluetooth printer. He reponded by saying, "Why would I ? I can just print through the network," I had been thinking of getting a bluetooth printer so my partner could print from downstairs, The printer upstairs prints through the usb cable from the mac pro. No ethernet connection no blutooth on this printer. So this is what leads me to the question.
    So it's the printer sharing I need to look at in system preferences ! Thanks. It's got to be possible to go cross platform. I print from both pc and mac to a printer in the room next to mine at school. I've never done anything but add printer from an available printer list which is identifiedby room number or entering the ip address for the printer. I've not needed to do anything about sharing printer in settings. Would this mean the mac pro which it's connected to needs to be on to print from the pcee downstairs or just that the network be active ?
    Thanks

  • Sending stuff over the network

    Hi!
    How do you send int:s, floats and all other basic datatypes trough the network? Is there any package that can make them all to byte[] and back or do you have to write all yourself?

    See java.io.ObjectOutputStream and ObjectInputStream.
    Essentially, these classes "package" java primitives and objects (that implement java.io.Serializable) for output and "unwrap" them for input.

  • Send BufferedImage over the network

    I have already successfully setup a client/server connection. The issue, is when I send the BufferedImage over the network, it says:
    "Caused by: java.io.NotSerializableException: java.awt.image.BufferedImage"
    Can someone please tell me how to fix this?

    Like the exception say, BufferedImage is not serializable. You cannot serialize it. The problem will go away if you don't try to serialize it. Of course, that doesn't answer the question you really meant to ask... which I'll leave for somebody else.

  • Why does my Apple TV on 5.2.1 not send audio through the optical cable to my ONKYO receiver?

    So I have my ATV hooked up to my tv through the HDMI cable because when I try do it it through my AV Receiver tx-ar608 from ONKYO then there is no picture nor any audio. The receiver works fine with anything else (e.g. bluray player, wii, playstation, laptop). To answer some questions that might pop up, yes I am very sure I am on the right channel and yes, the audio settings of the AVR are compatible with the ones of ATV. Now I can plug my HDMI cable into my tv and get some sound but as its only the tv speakers its pretty crap and i bought my ATV mainly to listen to music from my library. I tried to connedt my ATV with a digital audio cable and I can see the red light and it is plugged into the right socket and it is on the right setting and channel (games) but there is no audio from the receiver but only from the tv... Please help me with this.
    Much appreciated, Neil

    Hello Damian!
    Thank´s for your helping answer!
    Let me ask some more questions for better understanding:
    Is there a difference to load the new software with usb / Itunes ? Will Itunes find automatically the new apple TV update 5.0 (we talk about the latest and newest update with the different user surface)
    If "my" itunes won´t find the new software update, is the are chance or possibility to install the downloaded version, which i found in the internet. It is the version 1_5.0_9B179b_Restore.ipsw (487 MB size)? How will i get this version into Itunes?
    Maybe you can answer my new questions.
    Thank you once again for your efforts.
    rommi2

  • SAP BPC MS - Send email through the implementation of a package

    Hi everyone!!!
    I want to know if there is a way to create a package to send emails.
    I need to put a step in a custom menu that sends an email to notify users.
    I thought to do this via package execution. Maybe there is another way.
    I count on your help.
    Thanks!

    I am not aware of any way to use Data Manager packages to send email, unless the email content and execution happens in SQL. A SQL Mail command is something that could possibly be stored in a DM package, but that SQL feature is being phased out by Microsoft. Another potential option is to build a mail macro into the Excel workbooks. But there is no programmatic way in BPC to send mail like this as far as I know.
    Brian

  • How to create a jar having the contents of the jar in a byte array?

    Hi,
    I have a server and client application. My server returns the contents of the jar in the form of byte array to the client on a particluar method call. Now at the client end, i want to reconstruct the jar to be used. How do I do this?
    The server uses the JarInputStream to read the contents of the jar to be returned. I have tried using the JarOutputStream, but looks like this works fine if we have spearate class files to be added to the jar. Now that I have the contents of the jar itself, how do i recreate the jar?
    Can anyone please help me with this?
    Thanks
    Rajani

    Have you ever gotten the raw byte copy to work? If so, how?
    I download a jar via InputStream and save into a jar file via fileoutputstream. It always gets corrupted in the process. The new Jar file has the exact same number of bytes, but doesn't get past the Manifest on a -tvf. In fact, Winzip can open it fine, but can't extract. So close...yet so far.
    Here is a snapshot of my code:
    BufferedInputStream data1=new BufferedInputStream(con.getInputStream());
    DataInputStream data=new DataInputStream(data1);
    StringBuffer buf=new StringBuffer();
    try{
    while((theChar=data.read()) != -1)
    { buf.append((char)theChar); }
    } catch (Exception z){ logger.info("UpdateThread.read Done Reading jar file");}
    data.close();
    File newFile = new File("C:/MyJar.jar");
    FileOutputStream outstream2 = new FileOutputStream(newFile);
    DataOutputStream outstream1 = new DataOutputStream(outstream2);
    BufferedOutputStream outstream = new BufferedOutputStream(outstream1);
    byte [] bytes = buf.toString().getBytes();
    logger.info("Bytes of new Jar file = " + bytes.length);
    int i;
    for(i=0;i<bytes.length;i++){
    outstream.write(bytes);
    outstream1.close();
    outstream.close();
    Any ideas where I'm going wrong?

  • How to know the length of a Byte array?

    how to know the length a byte array if it is an argument of the method, e.g.
    public byte[] hash(byte[] data) throws Exception
    I wanna store the length of data into a integer in the method of hash, but no idea how to get it
    THanks!

    to conclude:
    I am a newbie, I wanna know , those "System"
    methods as well.What exactly does that have to do with your original question?
    or instance:
    System.arrowcopy() , where can I find the
    definition also?You probably meant System.arraycopy. The documentation is called JavaDoc and for Java 1.5 (a.k.a. 5.0) it can be found here: http://java.sun.com/j2se/1.5.0/docs/api/index.html
    If you've not yet found the API documentation, then I'm pretty sure you should start with some tutorials, they probably point to all the interesting documentation as well.

Maybe you are looking for