How use privatekey in usbkey with mscapi provider?

I write some code under jdk6,to show certificate in windows-my store,and use a certificate which common name is "3year" and it's privatekey is in a usbkey.I can show certificate ok,but can not get privatekey.
code:
          KeyStore ks = KeyStore.getInstance("Windows-MY","SunMSCAPI");
          ks.load(null );
          Enumeration<String> as1 = ks.aliases();
          while(as1.hasMoreElements()){
               String ss = as1.nextElement();
               X509Certificate cert = (X509Certificate)ks.getCertificate(ss);
               System.out.println( "SN =" + cert.getSerialNumber().toString(16) );
               System.out.println( "Issuer =" + cert.getIssuerDN().toString() );
               System.out.println( "subject=" + cert.getSubjectDN().toString() );
               System.out.println("-------------------------------------------");
          PrivateKey pk = (PrivateKey)ks.getKey("3year", "11111111".toCharArray());
          Cipher c2 = Cipher.getInstance("RSA/ECB/PKCS1Padding","SunMSCAPI");
          System.out.println(pk);
          c2.init(Cipher.DECRYPT_MODE, pk);
          c2.update(d1);
          byte[] d2 = c2.doFinal();
//          System.out.println( new String(d2) );
it print privatekey is null,but what?
I use PrivateKey pk = (PrivateKey)ks.getKey("3year", null),print privatekey is null also.

ghstark wrote:
windshome wrote:
...,but can not get privatekey.That is true and by design.I agree with this BUT I thought there was more to it. It was my understanding that, although one can't get the private key as a key usable by any provider, one is given a token that can be used by the SunMSCAPI provider in place of the private key. Therefore I don't understand why the OP gets 'null'.

Similar Messages

  • How to connect to MSaccess with sqlplus provided in oracle11g

    With an old sqlplus (version 3.3.4) I was able to connect successfully to MSAccess database using these parameters:  
              SQLPLUS username/password@odbc:myDSNtoMSAccess
    When using sqlplus provided in oracle11g (version 11.2.0.1) with the same parameters, I have this error message:
              ORA - 03121 : no interface driver connected - function not performed
    Can someone can help me?
    Thank you

    Sorry for taking so long to answer you, I'm back to work.
    Thank you all of you for your responses. Let me explain the situation:
    We develop software that need to store data in diffenrent kind of database. Most common one used by our client are MSAccess, SqlServer and Oracle. One of our client is forced to upgrade their Oracle 8i database to 11g. This client received a lot of small MSAccess database from their clients and after the validation of the MSAccess data, copy their content into Oracle. With Oracle8i and SQLPlus 3.3.4 we develop a SQL script to copy the data. The client need to login to is Oracle database using SQLPlus and run a script file that contain the following SQL procedure:
        COPY FROM username/pw@odbc:myDSNtoMSAccess INSERT tablename USING select * from tablename;
    We develop an application that do the same job and much more, but the client is an old fashion guy who only beleive in SQLPlus tools. Given that «the customer is always right», we recreate their Oracle environement with a server on which we installed the Oracle 11g database and a workstation on which we installed the Oracle client. We import successfully the dump file create with Oracle8i, and try some SQL request from the workstation with SQLPlus successfully. Our softwares were adjusted, recompiled and test successfully with Oracle 11g. The only thing that doesn't work is the login to MSAccess with SQLPlus. I think that Justin Cave is right «If memory serves, the ability to use SQL*Plus to connect to ODBC data sources was removed a long, long time ago». After some search and reading, the closest solution would be to use the Oracle gateway but it will be difficult to the client to use it because they will have to rename the MSAccess database and copy it on the specific path create with the ODBC on the Oracle server. This can be done easily, but different MSAccess database has to be validate and copy into Oracle by different user and this can happen in the same moment. So the gateway is not the solution.
    To be honest with you, we are not disappointed. The client will not have the choice to drop SQLPlus and use our application!!!
    Thank again to all of you and please excuse my english.

  • How use bean of array with tag "jsp:useBean"??

    hi,all
    a bean of array put request with a servlet and forward a jsp page,this jsp use "jsp:useBean" of tag get the bean of array.
    how do for jsp:useBean of tag??
    thx.....

    You can't use an array directly in a jsppage. first u have to write the line <useBean /> through which you can access youtr class
    <jsp:useBean id="email" class="Pack.Email" scope="session" />
    after writing this line you have your class in your hand, you can think of "email" as it is a class object of Email class which is a Bean...
    declare a private array in the Bean and then made method getArray() which will return an array ... then you can use your array in jsp....
    an example of using a class variable in JSp is given below
    public String[] getArray() // note method must be public
    return array;
    now in your jsp page you have to use that class with
    <jsp:useBean id="email" class="Pack.Email" scope="session" />
    and cnow you can use array like this....
    <%
    String[] array=email.getArray();
    for (int i=0; i< array.length;i++ )
    out.println(array]);
    %>
    Does it solve your problem now ?

  • How use system.out.println with a Java Swing Applet?

    Hi guys,
    I was just wondering what can I use to view output on the Java console with a Java Swing Applet?
    At the moment I'm using a JTextArea within the Applet for debugging but I want output to appear in the browser java console but system.out.println doesn't work.
    I'm viewing the Swing Applet on Netscape 4.7 browser.
    Any ideas?

    System.out.println()s work fine! I'm guessing that your problem is that you are looking at the wrong console window!
    You're using the Java Plug-in, right? On Windows, go to your Control Panel and double click "Java Plug-in". You should find a checkbox option to "Show Java Console" - make sure this is checked. Next time you fire up you JApplet, you should see a Java Console window popup.
    Hope this helps!

  • How use video generator ni5431 with visual c++

    i use a ni5431 video generator with visual c++.
    i generate a ccir signal and i want to modify attributes IMAGE_TOP, IMAGE_HEIGHT and IMAGE_WIDTH. When i change one of these attribute with VDG_SetAttribute(****,int) i can't obtain a signal.
    Thank you for your help.

    Proably the reason this question has gone so long without an answer is that the Vision forum only covers our NI Image Acquisition hardware (along with all NI Vision software), and not our signal generator hardware. That hardware is covered in the Signal Sources forum under the Measurment Hardware section, which is serviced by a different set of Enthusiasts and experts. If you ask your questions there, you should get a quick response.

  • Working with a BB in Hungary with Pannon provider

    Since a couple of month I am trying to connect my BB 8900 to our server at Vredestein company in Enschede, Netherlands. All of my colleagues all over Europe are using BB phones and it took them a few minutes to activate the entire services.My BB has been bought in Germany and I am using it in Hungary with Pannon provider. I have requested the enterprise solution and this has been activated since 2 months by the Hungarian provider (Pannon). Unfortunately, every attempt to connect the BB to our server failed. Has it to do with connection applications in the handheld? TCP/IP applications have to be changed? Please try to find a solution for using my BB in an appreciated way.Thank you in advance & with kind regards from Budapest!

    Thank you for your answer - in the meantiom we were able to solve the problem & everything works fine.  

  • How do I stop  my mail from send out my e-mails with the mobile me acct instead of my default provider?  I have checked the "use only this server" in my provider account.

    How do I stop  my mail from send out my e-mails with the mobile me acct instead of my default provider?  I have checked the "use only this server" in my provider account.

    There is no such option/setting on an iPhone to determine this. Whether you can view the attachment has more to do with your connection, WiFi or cellular, and the size of the attachment than anything else. There will be a paperclip indicating the message includes an attachment regardless if downloaded with the message or not. When connected to the cellular network, if an attachment is below a designated size the attachment will be downloaded automatically. If over a certain size, you must select the attached file icon in the body of the message to download the attachment. The size limit varies by carrier/provider.
    Tell her you're gonna leave her out of the Will if she doesn't stop .

  • I changed my provider and hence up-dated my iphone from a 3 to a 4.  I am travelling to the UK and want to unlock and take my old phone (iphone 3) to use in the uk with my UK sim card.  How do I do this??

    I changed my provider and hence up-dated my iphone from a 3 to a 4.  I am travelling to the UK and want to unlock and take my old phone (iphone 3) to use in the uk with my UK sim card.  How do I do this??

    you need to contact the provider of your old phone and find out 1) if the provider unlocks phones and 2) what the procedure is to get the phone unlocked.

  • Using droid in india supported with service provider, how to activate hotspot...its asking permission from verizone. updated to 4.4..pls help

    im using verizone provided ultra droid in india with service provider support..Reliance communication.
    All working fine except hotspot...on activating it insist on verizone permission....
    using on 4.4
    pls help
    >> Personal information removed to comply with the Verizon Wireless Terms of Service <<
    Message was edited by: Verizon Moderator

    HELPPPPPP !!!!!!!!!!

  • How can I use my time capsule with Ethernet cable? How is it also possible to use time capsule as a normal external hard drive?

    My problem is that I don't know how to use my Time Capsule with Ethernet Cable, as when I use wireless it is really slow.

    Make sure that there is an Ethernet cable from one of the LAN <-> ports on your modem/wireless router to the WAN port on the Time Capsule
    Click on the Wireless tab at the top of the page
    Change the setting for Wireless Mode to Off (I assume that you do not want the Time Capsule to provide a wireless network since you already have a wireless network)
    Next, click the Internet icon at the top of the screen, then click the Internet Connection tab
    Connect Using = Ethernet
    Connection Sharing = Off (Bridge Mode)
    Click the Update button at the bottom and wait 30 seconds for the Time Capsule to restart and display a green light
    Then, you must power off your entire network...all devices....in any order that you want
    Wait a minute
    Start your modem/router first and let it run a minute
    Start the Time Capsule and let it run a minute
    Keep starting devices one at a time until everything is powered up
    If you are using Time Machine for backups, you will need to reset the connection because you have changed the way in which the Time Capsule connects to your network
    Open System Preferences (gear icon) on the dock
    Open Time Machine
    Click Select Disk
    Click the Time Capsule to highlight it
    Click Use for Backup or, it might be Use Disk
    Now you can connect your Mac using an Ethernet cable to one of the LAN <-> ports on the Time Capsule to back up using Ethernet. Be sure to turn off the wireless on your Mac before you start the backup.
    If you want to backup using wireless, disconnect the Ethernet cable from the Mac to the Time Capsule and turn on the wireless and connect to your wireless network. Your computer will now backup using wireless.

  • How to get web application to use Tuscany without conflicting with SAP SDO

    Hi,
    We are attempting to run a web application on SAP NetWeaver CE 7.1 SP1 which uses Tuscany SDO.  As it now stands We must use Tuscany because the web application will not run with the SAP SDO implementation provided by Netweaver. To ensure that Tuscany is loaded with priority, we have packaged the Tuscany JAR files and their dependencies as a heavy resource, as described here:
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60642a88-95fe-2b10-d387-a245d48fc257?overridelayout=true
    The final check showed that Tuscany was correctly deployed as a heavy resource and included the following JAR files:
    common-2.2.3.jar
    ecore-2.2.3.jar
    ecore-change-2.2.3.jar
    ecore-xmi-2.2.3.jar
    tuscany-sdo-impl-1.1.1.jar
    tuscany-sdo-lib-1.1.1.jar
    tuscany-sdo-tools-1.1.1.jar
    xsd-2.2.3.jar
    We also verified that the web application using Tuscany has a hard reference to the Tuscany heavy resource.
    However, when we try to run the web application, the following error is logged:  java.lang.LinkageError: Class commonj/sdo/DataGraph violates loader constraints
    The issue is definitely due to some kind of classloading conflict with the SAP SDO library, as the application runs normally when SAP SDO is manually removed from the classpath. Doing this on a production system is unfortunately not an option, though.
    So the question is: how to get web application to use Tuscany without conflicting with SAP SDO?

    I took a look at the "printerReady" example.  Looks like I may be able to use the InetPing (...) function to ping through a range of IP addresses looking for a response.
    Any ideas on how to find the MAC address associated with the IP addresses that respond?
    We may have multiple units responding and the MAC address will allow the operator to determing which unit to connect to.
    I'll try the InetPing to see how it works,
    Kirk

  • How to use another SIM card with my AT&T Iphone

    I have to go in france and use a French office' sim card from another provider than AT&T. But here, I've got all my professional, and private, mail box and conatct on it.
    How have I to do in order to use this other sim card in my Iphone? I don't want to buy another cell phone for only few weeks in year !
    When I was in france my provider was agree to unlock my old iphone before leaving the country. that's why that was easy for me to use it in US with an AT&T sim card. But now, they change my oldest 3g with a new one, it is impossible for me to have the same situation ...
    and I'm a AT&T customer since more two years ...

    There is no way to use a phone locked to AT&T with another provider.  AT&T does not unlock iPhones for anyone.  Ever..

  • How to use a Web Template with queries from multiple BW Systems?

    Hi all,
    can anybody help me how to use a Web Template with queries (DATA PROVIDER)in it from multiple BW Systems?
    Thanks in advance, best regards
    Frank

    Great! Thanks for the quick response.
    Have you tried this for XMLA datasources created within the EP system also?
    i.e use Web Analyzer to create a view from the XMLA source and use that view within WAD?
    Thanks.

  • How can I set up a guest access point with a Time Capsule and an Airport Extreme? I am using a Telus router with the Time Capsule used as a wireless access point (bridge mode). I don't want the guest access point to have access to my network.

    How can I set up a guest access point with a Time Capsule and an Airport Extreme? I am using a Telus router with the Time Capsule used as a wireless access point (bridge mode). I don't want the guest access point to have access to my network.

    The Guest Network function of the Time Capsule and AirPort Extreme cannot be enabled when the device is in Bridge Mode. Unfortunately, with another router...the Telus...upstream on your network, Bridge Mode is indicated as the correct setting for all other routers on the network.
    If you can replace the Telus gateway with a simple modem (that performs no routing functions), you should be able to configure either the Time Capsule or the AirPort Extreme....whichever is connected to the modem....to provide a Guest Network.

  • How To Use Your Own Router with Out Loosing Verizon's FIOS Services

    How to use your own router with Verizon’s FIOS Service
    First, you need a basic understanding of how FIOS works but unfortunately there are two types of FIOS systems out there. All of the systems utilize a fiber optic cable to bring TV, phone and internet to your location over one optic cable. In addition these systems provide interactivity including widgets, remote DVR, movies on demand and so forth via an IP (Internet Protocol) signal.  Your STB (Set Tip Box) requires both a video and IP signal. The IP signal is necessary for all of the aforementioned interactivity.  The fiber cable terminates at the Optical Network Terminal or ONT for short.  The ONT converts the optics into a digital signal that can be utilized by ones equipment.  From the ONT your video, phone and internet are provided to the location.  This is where things can differ as the internet signal can be provided via a coaxial (MoCA or Multimedia over Coax Alliance) or RJ45 Cat5 (Ethernet) cable.  It is important to identify and understand the differences of these two setups.  In my case I have my internet entering via Ethernet cable, which in my humble opinion makes things a heck of a lot easier.
    How does one tell the difference? In most cases it’s rather simple; just look at the Verizon’s router WAN (Wide Area Network) Port.  Does it have a RJ45 (Ethernet) or Coax (TV cable Cord) going to it? If the router’s WAN port doesn’t have a coaxial connector then one will need to convert the MoCA signal into a usable Ethernet signal that routers understand. The easiest way is to use Verizon’s router as a bridge. In this method the Verizon’s router simply converts the signal and passes it along to your own router. The challenge is to try to maintain the interactivity that FIOS TV provides. Because of this one needs to supply the IP routed signal back to the FIOS router.  There are multiple methods for doing this and I would recommend investigates which one make the most sense.   
    In my particular case the IP signal was provided by Ethernet.  Again there are various ways of installing one’s own router. The hardest is to utilize Verizon’s router as a bridge.  This setup requires configuring Verizon’s router as a bridge and also creating a VLAN (Virtual Local Area Networks). In addition one needs to set up their own router so it will work with the various routing tables and networks. For me this is too complex for the average person and it can be difficult to trouble shoot if something goes wrong. Please consider that Verizon will not support utilizing third party routers.   
    The easier method is to request an Ethernet signal (if you don’t already have one) from their ONT.  I would highly recommend getting your hands on a NIM or Network Interface Module. This device is used to convert Ethernet to Coaxial so it can be fed back to your STBs.  These can be purchased online and Verizon technicians can be a valuable resource with these sorts of acquisition.  At the very least they can point you to the right direction.  Once you have a NIM the rest is rather simple.
    Log into the current Verizon Router.
    Located the router’s MAC address and copy it down.
    Go to the port forwarding section and copy down the Applied Rules. 
    Example:  
    Network Computer/Device: 192.168.1.100:63145
    Application & Ports Forward:  Application UDP Any -> 6347  
    Note: There may be up to three entries for each one of your Set Top Boxes.
    Look at your current device list, typically found on the home screen. Copy down your STB MAC and IP address.
    Example:
    IP-STB1
    Connection Type: Ethernet
    * IP Address: 192.168.1.100
    IP Address Allocation: DHCP
    *MAC Address:                07:73:fFe:ad:8b:3f
    * Things you will need to write down
    Go to the network section and look for the main Ethernet connection.  Select this and then select more setting, typically found at the bottom. Release the current lease.
    Remove the Verizon router
    Install your router
    Connect the NIM by plugging in an Ethernet from one of the routers LAN (Local Area Network) ports to your NIM. Then connect the coax cable, the same cable that was used by Verizon router.
    Set you DHCP routing IP pool to accommodate Verizon’s STB IP’s  (note their IP’s start at 192.168.1.100)
    Go to DHCP section and reserve the STB IP’s by inserting the IP’s and MAC addresses. This shall ensure that nothing else utilizes the same IPs as the STBs thereby preventing IP address conflict.  
    Add the port forwards from Step 5 above.
    Clone Verizon’s Mac Address utilizing the info from step 2
    Finish setting up the router in typical fashion.
    Unplug and re-plugin your STB’s and test functionality.  It’s best to try using a widget or Movie on demand function.
    Note: if the new router can net get an internet signal contact Verizon’s support and have them release the IP and reset the ONT.  
    EVERYTHING should be working at this point.

     3 Go to the port forwarding section and copy down the Applied Rules. 
    Example:  
    Network Computer/Device: 192.168.1.100:63145
    Application & Ports Forward:  Application UDP Any -> 6347  
    Note: There may be up to three entries for each one of your Set Top Boxes.G
    Your display obviously is not like mine as mine does not dosplay the port associated with the ip address
    whatever, the STB's start at 192.168.1.100 and icement by 1 for each
    the port addr's will be 63145 alo incrementing by 1
    there is 1 entry for each in my pf list
    however each ip addr also has a port entry starting at 35000 also incrementing by 1 for each ip addr
    For some unknow reason these are duplicated e.g I appear to have 11 entries exaactly the same for each stb and as the fios services rules have no action switc there is nowhere to delete the extraneous garbage.
    Why do you clone the mac addr??

Maybe you are looking for