What are the correct steps to signing a token using SHA1 in PKI

I am implementing a PKI solution. My encryption of a clear text token is done as follows:
public static String encrypt(String token) throws Exception {
          Cipher cipher = Cipher.getInstance("RSA/NONE/PKCS1Padding", provider);
          cipher.init(Cipher.ENCRYPT_MODE, publicKey);
          byte[] stringBytes = token.getBytes("UTF8");
          byte[] raw = cipher.doFinal(stringBytes);
          // BASE64 encode the result
          String s = encoder.encode(raw);
          // URL Encode
          String senc = URLEncoder.encode(s, "UTF-8");
          return senc;
     }Now this is what I am doing in my code to sign the message..
public static String sign(String token) throws Exception {
                Signature signer = Signature.getInstance("SHA1/RSA", provider.getName());
          signer.initSign(privateKey);
          byte[] stringBytes = token.getBytes("UTF8");
          signer.update(stringBytes);
          byte[] signature = signer.sign();
          // BASE64 encode the string result
          String s = encoder.encode(signature);
          String senc = URLEncoder.encode(s, "UTF-8");
          return senc;
     }Please look at the method sign() and inform me if I am doing the following in the sign() method..
I am being asked to hash the clear token with SHA1 and then use the private key to encrypt it with RSA.
In my method I am signing the token using the private key but it looks like I am not hasking the token first and then signing it with the private key.
Can someone please provide me with a code snippet where in I am first hashing the token using SHA1 and then signing the key with my private key..
Thanks in advance..

Thanks a ton. I am using BC provider but I will switch to SHA1withRSA.
I read that Signature.update() does that but had to confirm with the experts on this excellent forum.
I do a bit of PKI implementation with various vendors every once in a while at work. I love this area of specilization and would love to gain proficiency on Security and Cryptography. Are there any good resources for people like me. I usually benefit from sample scenarios and code.
Thanks in advance..

Similar Messages

  • What are the correct steps for installing Oracle Entitlement Server SSM?

    Can somebody explain what are the correct steps to install OES SSM 10.1.4.3? I have installed OES admin 10.1.4.3 and applied the CP2 patch. it is allowing me to open Entitlement Administration, where I can define the policy.
    Is it sufficient to have this Entitlement Admin to call the policy from BPM? Do I need a SSM ?
    When I try to configure Java SSM using ConfigTool.bat -process myssm_config.properties I am getting the following error
    Is Admin in the same BEA-HOME as SSM: [default: Yes]:
    Give the location of the Admin: c:\bea\ales32-admin
    Enter the identity directory name which will be used: [default: CoESSM_dir]:
    Enter the root node which will be used to create resources: [default: //app/policy/CoESSM_app]:
    Checking if default ARME port is free: 8000
    Generating policy files based on templates ...
    Checking if SSM instance already present
    Checking to see if SSM ARME port is free.
    Checking JDBC parameters...
    Checking to see if asipassword was run...
    2010-03-15 18:06:59,295 [Main Thread] ERROR com.bea.security.SsmConfigTool.AlesConfig - You need to run asipassword first
    2010-03-15 18:06:59,295 [Main Thread] ERROR com.bea.security.SsmConfigTool.ConfigurationTool - Error making changes: You need to run asipassword first
    I have tried running the asipassword utility, but still it gives the same error. Please let me know what am I doing wrong?

    Yes I have explored this pdf...but it doesn't tell how to use the policy from the BPM. My question is if I want to use the policies from BPM, then do I need to install the SSM ?
    If yes, what are the correct steps of installation ?
    I am getting the errors while configuring the Java SSM.
    Is Admin in the same BEA-HOME as SSM: [default: Yes]:
    Give the location of the Admin: c:\bea\ales32-admin
    Enter the identity directory name which will be used: [default: CoESSM_dir]:
    Enter the root node which will be used to create resources: [default: //app/policy/CoESSM_app]:
    Checking if default ARME port is free: 8000
    Generating policy files based on templates ...
    Checking if SSM instance already present
    Checking to see if SSM ARME port is free.
    Checking JDBC parameters...
    Checking to see if asipassword was run...
    2010-03-15 18:06:59,295 [Main Thread] ERROR com.bea.security.SsmConfigTool.AlesConfig - You need to run asipassword first
    2010-03-15 18:06:59,295 [Main Thread] ERROR com.bea.security.SsmConfigTool.ConfigurationTool - Error making changes: You need to run asipassword first
    I have tried running the asipassword utility, but still it gives the same error. Please let me know what am I doing wrong?

  • Transfer ADOBE creative Suite from an old Mac to a new Mac, I have the code but I don't have a CD. What are the correct steps?

    Hi
    I bought a new Mac and I want to transfer my Adobe Creative Suit CS6 to it from my old one. What are the correct steps? Please note that I don't have a CD because I downloaded it via the net. It was an upgrade for the student edition. I heard something about deactivation and reactivation but I don't want to do something wrong then lose my precious software. Please help. Thanks.

    You can download the software and install it using the page linked below.
    CS6 - http://helpx.adobe.com/x-productkb/policy-pricing/cs6-product-downloads.html
    You are allowed to have the software installed and activated on two machines, so there should be no reason to deactivate it on your other machine, or at least you can wait until you see it loaded and working on the new one.

  • What are the correct settings for my WRT54GS for using remote access on a Windows Home Server?

    I can not remotely access my Windows Home Server from outside.  What are the correct settings for my WRT54GS?

    I have opened ports 80, 443,and 4125 to PCP.  The  router address is http://192.168.1.1, my address is 221.40.138.170.
    Thank you.

  • What are the correct steps for installing SP1 over Sharepoint 2010

    Hi,
    I have SharePoint 2010 (Release To Manufacturing) environment and am planning to to upgrade it to SP1. May I please know the correct steps
    to install SP1 on to my environment(2WFE + 2APP servers & 64 bit OS).

    SP2 provides key updates and fixes across our servers, services and applications including security,
    stability, and performance enhancements and provides better compatibility with Windows 8, Internet Explorer 10, Office 2013, and SharePoint 2013.
    also your Sharepoint is upto date version, you will get all the functionality which
    you will losing since you are prior to SP1.
    i.e Site Recycle bin,
    Content Deployment fixes, . you can go throw all the kB articles which will tell you what fixes in it.
    http://blogs.technet.com/b/stefan_gossner/
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • What are the config steps for contract mass change and quota arrangement?

    Hi friends
    what are the config steps for contract mass change and quota arrangement?
    Regards
    Raj Kumar

    Process Flow
    The mass change process consists of four steps. You navigate between these steps by choosing the Next and Back buttons located at the bottom right-hand corner of the screens.
           1.      Search for contracts
    You search for and select the contracts or the contract hierarchy that you want to change.
    Contracts that have the status Closed cannot be changed.
           2.      Define mass changes
    You specify the changes you want to make.
    You make changes at header data level and at item data level by choosing the relevant change methods. A green tick appears next to each change parameter so that you can see where changes are already active.
    Once you enter this step, the documents you have selected to be changed are locked so that other users cannot make changes to them until you are finished with this process.
           3.      Simulate mass changes
    Here you can perform a trial run of your mass changes. This simulation step is optional.
    We recommend that you perform this step so that you can check how the change methods you have chosen will be processed by the system.
    You receive status messages about the change methods for each contract and can quickly see whether any errors arise in connection with the proposed changes at this stage. From this step, it is easier for you to go back and correct the error than after applying the changes.
    Background processing
    The system processes the changes in the background.
    If there are a large number of contracts to be processed, this step could take some time to complete. In this case, you can leave the transaction so that you can, for example, carry out other tasks in the meantime.
    The system sends you an e-mail once the simulation step is complete. The e-mail contains a link to the relevant screen in the application so that you can return to it when it is convenient for you to do so. If you have left the SRM application, you can only return via this link.
    Here you can see the status of the changes and, if necessary, you can correct any errors by going back to the Define mass changes step.
    The messages that you receive in the simulation step are not confirmation that a change has been performed. They simulate the messages you get after you apply the changes. You must complete the final step of the mass change process and apply the changes before they take effect.
           4.      Carry out mass changes
    Here you apply the changes to the contracts.
    You cannot reverse this step, which is why we advise you to perform the simulation step beforehand.

  • What are the installation steps for Oracle Fusion HCM

    Hi all
    I will like to ask, what are the installation steps for Oracle Fusion HCM as well as can it work on Windows or only on virtual machine?
    Thanks

    If you're looking to install Fusion HCM, your best bet is to install on linux, eg, Oracle Enterprise Linux. It's up to you whether you put that in a Virtual Machine or not. I don't think Windows is an available platform for Fusion Apps at the moment, although am prepared to be corrected if you find anything to the contrary!
    If you're looking to do an install on your own PC/laptop, you're probably out of luck - you'll be needing around 128GB of RAM. Check out this post:
    http://onlineappsdba.com/index.php/2011/11/02/fusion-applications-128-gb-memory-and-500-gb-disk-space-are-you-ready/
    Atul has also posted some good stuff on installing:
    http://onlineappsdba.com/index.php/2011/06/15/install-oracle-fusion-applications-in-10-steps/

  • What are the correct domain settings @ Go Daddy?

    I will set up a Mac Mini Lion Server using server assistant.  I bought a domain name from Go Daddy. What are the correct domain (DNS, host) settings @ Go Daddy - need step by step guide; thanks in advance.

    I do not fully understand how the PTR pointer works
    PTRs map IP addresses back to hostnames - also known as 'reverse DNS'.
    The way it works is that when you (or any client) looks up an IP address they first query the root servers that maintain a map of the main IP address allocations. You then query the server that's authoritative for the IP address in question. That server may respond, or may further delegate responsibility to another server.
    As an illustration, imagine a company - MegaISP - who's been allocated a large block of IP addresses - say 1.0.0.0 through 1.255.255.255. As an ISP they provide access service in all 50 states so they may further subdivide their network into chunks and delegate control of each chunk to a different server, e.g. 1.1.0.0 - 1.1.255.255 -> CA, 1.2.0.0 - 1.2.255.255 -> NY, etc.
    Now you, as a customer of MegaISP, connect to their server and are allocated a dynamic address from the 1.2.0.0 - 1.2.255.255 subnet - let's say 1.2.3.4
    When you perform a reverse lookup on 1.2.3.4 your query first goes to the root servers which say something like 'hey, those IPs are owned by MegaISP's DNS servers, so go ask them'. You then query MegaISP's main servers which then say 'hey, that IP is somewhere in the New York subnet, so go query the New York DNS server. Your query then goes to MegaISP's New York server that replies something like 'host-1-2-3-4.ny.megaisp.net' and that' your reverse lookup.
    (of course, this is greatly simplified, and the whole process takes a fraction of a second, but hopefully you get the idea).
    The problem you now have is that MegaISP have no idea what services you're running on your connection, so they just return a generic response (e.g. host-1-2-3-4.ny.megaisp.net) and not something that relates to your domain (e.g. www.yourdomain.net). Nobody knows to ask your DNS server what hostname your IP address should map to.
    In order for that last step, MegaISP either have to change their DNS servers to map your IP address to your domain name rather than the generic hostname, or they have to further delegate your IP address's lookup to your own server (i.e. add another link in the chain - like 'hey, that IP address is delegated to yourdomain.net, so go ask their server').
    Most ISPs are happy to either delegate or have a custom entry for your domain, but not on dynamic or residential-grade connections - it's not worth the time and effort to keep it up to date as your IP address changes, which is why it's typically only something that comes with business-grade services.
    and what limitations this will lead to
    Any service that relies on valid reverse DNS is doomed to fail. For the most part, http doesn't matter/care, but don't expect to run a mail server or certain other services.

  • What are the main steps to be taken care while doing recording for LSMW

    Hi,
    I am facing problem in LSMW.
    Can anybody suggest me that What are the main steps to be taken care while doing recording for LSMW for recording mm01 ?
    thanks'
    naresh

    Hi,
    Recording in LSMW is similar as SHDB.
    in LSMW after you give Project-Subproject and Object.
    1)Go to-> Maintain Object Attributes -> double click
    2)Press Display/Change Button at top left to make editable mode.
    3)Select radiobuton -> Batch Input -> Give Recording name say Z_mm01
    4) Click the Recording Overview boton on right -> Give TCode which u want to record....
    Rest refer the Document link attached.
    Please find the links to various threads on the same.
    Re: LSMW - Using a BAPI
    BAPI, IDOC in LSMW
    Upload the data in LSMW using BAPI
    This one is the most complete document for the same
    http://sapabap.iespana.es/sapabap/manuales/pdf/lsmw.pdf
    http://service.sap.com/lsmw.
    Regards
    Kiran

  • What are the correct answers ?

    after doing one sample swing application, i assumed the exam will be easy. when i took the exam, i couldn't do anything...
    what are the correct answers ??/
      Which one of the following converts the Image i into the BufferedImage bi? 
    Choice 1  
    bi = new BufferedImage(0, 0, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = (Graphics2D)bi.createGraphics();
    g.drawImage(i,i.getHeight(this),i.getWidth(this)); 
    Choice 2  
    bi = new BufferedImage(i.getWidth(this), i.getHeight(this), 1);
    bi.drawImage(i,0,0,this); 
    Choice 3  
    bi = new BufferedImage(i.getWidth(this), i.getHeight(this), 1);
    Graphics2D g = (Graphics2D)bi.createGraphics();
    g.drawImage(i,0,0,this); 
    Choice 4  
    bi = new BufferedImage(i, i.getWidth(this), i.getHeight(this), BufferedImage.TYPE_INT_RGB); 
    Choice 5  
    bi = new BufferedImage(i, i.getWidth(this), i.getHeight(this)); 
    CardLayout
    BorderLayout
    FlowLayout
    GridBagLayout
    GridLayout 
      Which one of the following indicates all of the layout managers (from the list above) that allow you to set the space between the components from an instance of the LayoutManager itself? 
    Choice 1  
    CardLayout, FlowLayout, GridBagLayout, GridLayout 
    Choice 2  
    GridBagLayout 
    Choice 3  
    BorderLayout, GridLayout 
    Choice 4  
    BorderLayout, FlowLayout, GridLayout 
    Choice 5  
    BorderLayout, CardLayout, FlowLayout, GridBagLayout, GridLayout 
    JFrame jf = new JFrame();
    jf.setSize(400,400);
    JTextField jtf = new JTextField("JTextField");
    JButton jb = new JButton("JButton");
    jf.getContentPane().setLayout(
                          new FlowLayout(FlowLayout.LEFT,1,2));
    jf.getContentPane().add(jtf);
    jf.getContentPane().add(jb); 
      Which one of the following indicates the positions of the JTextField jtf and JButton jb relative to the JFrame and each other? 
    Choice 1  
    jtf and jb are in the top-center of the Jframe; jtf is to the left of jb, 2 pixels apart. 
    Choice 2  
    jb is in the top-right corner of the JFrame with jtf 1 pixel to the left of it. 
    Choice 3  
    jtf is in the top-left corner of the JFrame with jb 1 pixel to the right of it. 
    Choice 4  
    jb is in the top-right corner of the JFrame with jtf 2 pixels to the left of it. 
    Choice 5  
    jtf is in the top-left corner of the JFrame with jb 2 pixels to the right of it
    public void drawText(Graphics2D g, String text){
      Font f = new Font("Century Gothic", Font.BOLD, 10);
      g.setFont(f);
      g.drawString(text, 20, 20);
      Given the above sample code, what happens if the "Century Gothic" font is NOT available? 
    Choice 1  
    The Font() constructor fails, causing "f" to be null, and the setFont() method throws a NullPointerException. 
    Choice 2  
    "Century Gothic" is a built in Java font, which always exists within the Java runtime environment. 
    Choice 3  
    The code does not compile because only the following "logical" font names are supported in Java: Dialog, DialogInput, Monospaced, Serif, SansSerif, and Symbol. 
    Choice 4  
    The Font() constructor throws an IllegalArgumentException. 
    Choice 5  
    A default Font object is returned and is used
    Sample Code 
    public void drawText(Graphics2D g, String text){
      Font f = new Font("Century Gothic", Font.BOLD, 10);
      g.setFont(f);
      g.drawString(text, 20, 20);
      Given the above sample code, what happens if the "Century Gothic" font is NOT available? 
    Choice 1  
    The Font() constructor fails, causing "f" to be null, and the setFont() method throws a NullPointerException. 
    Choice 2  
    "Century Gothic" is a built in Java font, which always exists within the Java runtime environment. 
    Choice 3  
    The code does not compile because only the following "logical" font names are supported in Java: Dialog, DialogInput, Monospaced, Serif, SansSerif, and Symbol. 
    Choice 4  
    The Font() constructor throws an IllegalArgumentException. 
    Choice 5  
    A default Font object is returned and is used. 
    How must do you interact with a JTextField in order to generate an ActionEvent? 
    Choice 1  
    Tab into the JTextField from another Component. 
    Choice 2  
    Type in the JTextField. 
    Choice 3  
    Activate the cursor in the JTextField. 
    Choice 4  
    Hit <RETURN> while the cursor is in the JTextField. 
    Choice 5  
    Hit the spacebar while typing in the JTextField. 
    double-buffering
    public class TimerTest implements ActionListener{
      public static void main(String[] args){
        TimerTest test = new TimerTest();
        javax.swing.Timer timer = new javax.swing.Timer(100,test);
      public void actionPerformed(ActionEvent ev){
        System.out.println("Timer ticked.");
      Given the above sample code, what is the result when the code is run? 
    Choice 1  
    The words "Timer ticked." are printed to the console once after 100 milliseconds. 
    Choice 2  
    The words "Timer ticked." are printed to the console every 100 microseconds. 
    Choice 3  
    The words "Timer ticked." are printed to the console every 100 seconds. 
    Choice 4  
    The words "Timer ticked." are printed to the console every 100 milliseconds. 
    Choice 5  
    Nothing, the Timer is not started. 
    1. JSlider slider1 = new JSlider (JSlider.VERTICAL, 0, 100, 50);
    2. slider1.setPaintTicks(false);
    3. slider1.setMajorTickSpacing(10);
    4. slider1.setMinorTickSpacing(2); 
      What changes do you have to make to the above Sample code so that there are six Major Ticks and four Minor ticks between each Major Tick? 
    Choice 1  
    Replace line 3 with slider1.setMajorTickSpacing(17); 
    Choice 2  
    Replace line 2 with slider1.setPaintTicks(true);
    Replace line 3 with slider1.setMajorTickSpacing(17);
    Replace line 4 with slider1.setMinorTickSpacing(5); 
    Choice 3  
    Replace line 3 with slider1.setMajorTickSpacing(5);
    Replace line 4 with slider1.setMinorTickSpacing(4); 
    Choice 4  
    Replace line 2 with slider1.setPaintTicks(true);
    Replace line 3 with slider1.setMajorTickSpacing(20);
    Replace line 4 with slider1.setMinorTickSpacing(4); 
    Choice 5  
    Replace line 4 with slider1.setMinorTickSpacing(6); 
       Which one of the following defines a set of three JRadioButtons (b1, b2, and b3) so that only one JRadioButton can be selected at a time? 
    Choice 1  
    ButtonGroup g = new ButtonGroup();
    g.add(b1); g.add(b2); g.add(b3); 
    Choice 2  
    b1.group(true); b2.group(true); b3.group(true); 
    Choice 3  
    JRadioButton jbs[] = {b1, b2, b3};
    ButtonGroup g = new ButtonGroup(jbs); 
    Choice 4  
    The default behavior of JRadioButtons is such that only one can be selected at a time as long as they are in the same Container. 
    Choice 5  
    ButtonGroup g = new ButtonGroup(b1, b2, b3); 
    Sample Code 
    public static void main(String args[]){
      What is the role of the method in the code above? 
    Choice 1  
    To provide a place for initialization code when instantiating the current class. 
    Choice 2  
    It is the first method run when a class is run with the Java Interpreter. 
    Choice 3  
    It serves no specific function. It is a residual method from Java 1.0. 
    Choice 4  
    It is the first method that the Java Compiler converts to bytecode when creating a .class file. 
    Choice 5  
    To process command-line parameters when running the Java Interpreter 
    How do you create a menu item, Save, with a shortcut key of Ctrl+S? 
    Choice 1  
    You have to override the KeyPressed event of the top level Frame and handle the Ctrl+S to call the menu item's actionPerformed. 
    Choice 2  
    JMenuItem save = new JMenuItem("Save");
    save.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,Event.CTRL_MASK)); 
    Choice 3  
    JMenuItem save = new JMenuItem("Save");
    save.enableShortcut(KeyEvent.CTRL_KEY + KeyEvent.S); 
    Choice 4  
    JMenuItem save = new JMenuItem("Save");
    save.setMnemonic("Ctrl+S"); 
    Choice 5  
    JMenuItem save = new JMenuItem("Save");
    save.addShortcutKey( new KeyStroke(KeyStroke.S | KeyStroke.CTRL_KEY) ); 
    GridBagConstraints gbc1 = new GridBagConstraints(1,1,2,1,1,3,10,1,new Insets(5,5,5,5),1,1);
    gbl.addLayoutComponent(jb,gbc1); 
      In regards to the above code, which one of the following indicates jb's grid position? 
    Choice 1  
    Grid position 2,1 
    Choice 2  
    Grid position 1,2 
    Choice 3  
    Grid position 1, 1 
    Choice 4  
    Grid position 10, 1 
    Choice 5  
    Grid position 1, 3 
    GridBagConstraints gbc1 = new GridBagConstraints(1,1,2,1,1,3,10,1,new Insets(5,5,5,5),1,1);
    gbl.addLayoutComponent(jb,gbc1); 
      In regards to the above code, which one of the following indicates jb's grid position? 
    Choice 1  
    Grid position 2,1 
    Choice 2  
    Grid position 1,2 
    Choice 3  
    Grid position 1, 1 
    Choice 4  
    Grid position 10, 1 
    Choice 5  
    Grid position 1, 3 
    Which one of the following is necessary when changing an Applet to a standalone application? 
    Choice 1  
    Add a no-argument constructor. 
    Choice 2  
    Remove the init(), start() and stop() methods. 
    Choice 3  
    Remove "extends JApplet" or "extends Applet". 
    Choice 4  
    Add a main() method. 
    Choice 5  
    Change the import statement so that it imports an Application container rather than Applet or JApplet. 
    Which one of the following adds the String "Java" to the JComboBox jcb? 
    Choice 1  
    ComboBoxModel cbm = jcb.getModel();
    cbm.addItem("Java"); 
    Choice 2  
    jcb.setText("Java"); 
    Choice 3  
    ComboBoxModel cbm = jcb.getModel();
    cbm.add("Java"); 
    Choice 4  
    jcb.add("Java"); 
    Choice 5  
    jcb.addItem("Java");

    I'll have a go but I am not saying they are all correct...
    Question 1.
    Which one of the following converts the Image i into the BufferedImage bi?
    Choice 3 (assuming this implements the imageobserver interface)
    bi = new BufferedImage(i.getWidth(this), i.getHeight(this), 1);  //1 is BufferedImage.TYPE_INT_RGB
    Graphics2D g = (Graphics2D)  
    bi.createGraphics();
    g.drawImage(i,0,0,this);Good luck with your homework...
    nes
    Question 2.
    CardLayout
    BorderLayout
    FlowLayout
    GridBagLayout
    GridLayout
    Which one of the following indicates all of the layout managers (from the list above) that allow you to set the space between the components from an instance of the LayoutManager itself?
    Choice 4
    BorderLayout,
    FlowLayout,
    GridLayout
    (GridBagLayout uses GridBagConstraints to decide component spacing, card layout does not provided component spacing due to the deck nature used)
    Question 3.
    JFrame jf = new JFrame();
    jf.setSize(400,400);
    JTextField jtf = new JTextField("JTextField");
    JButton jb = new JButton("JButton");
    jf.getContentPane().setLayout( new FlowLayout(FlowLayout.LEFT,1,2));
    jf.getContentPane().add(jtf);
    jf.getContentPane().add(jb);    Which one of the following indicates the positions of the JTextField jtf and JButton jb relative to the JFrame and each other?
    Choice 3 jtf is in the top-left corner of the JFrame with jb 1 pixel to the right of it.
    Question 4
    public void drawText(Graphics2D g, String text)
         Font f = new Font("Century Gothic", Font.BOLD, 10);  
         g.setFont(f);  
         g.drawString(text, 20, 20);
    }    Given the above sample code, what happens if the "Century Gothic" font is NOT available?
    Choice 5 A default Font object is returned and is used
    Question 5.
    How must do you interact with a JTextField in order to generate an ActionEvent?
    Choice 4 Hit <RETURN> while the cursor is in the JTextField.
    Question 6.
    public class TimerTest implements ActionListener
         public static void main(String[] args)
               TimerTest test = new TimerTest();    
               javax.swing.Timer timer = new javax.swing.Timer(100,test);  
         public void actionPerformed(ActionEvent ev)
              System.out.println("Timer ticked.");  
    }    Given the above sample code, what is the result when the code is run?
    Choice 5 Nothing, the Timer is not started.
    Question 7.
    1. JSlider slider1 = new JSlider (JSlider.VERTICAL, 0, 100, 50);
    2. slider1.setPaintTicks(false);
    3. slider1.setMajorTickSpacing(10);
    4. slider1.setMinorTickSpacing(2);    What changes do you have to make to the above Sample code so that there are six Major Ticks and four Minor ticks between each Major Tick?
    Choice 4 Replace line 2 with slider1.setPaintTicks(true); Replace line 3 with slider1.setMajorTickSpacing(20); Replace line 4 with slider1.setMinorTickSpacing(4);
    Question 8.
    Which one of the following defines a set of three JRadioButtons (b1, b2, and b3) so that only one JRadioButton can be selected at a time?
    Choice 1 ButtonGroup g = new ButtonGroup(); g.add(b1); g.add(b2); g.add(b3);
    Question 9.
    Sample Code
    public static void main(String args[]){ }
    TYPO - should be public static void main(String[] args){ }
    What is the role of the method in the code above?
    Choice 2 It is the first method run when a class is run with the Java Interpreter.
    Question 10.
    How do you create a menu item, Save, with a shortcut key of Ctrl+S?
    Choice 2 JMenuItem save = new JMenuItem("Save");
    save.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,Event.CTRL_MASK));
    Question 11.
    GridBagConstraints gbc1 = new GridBagConstraints(1,1,2,1,1,3,10,1,new Insets(5,5,5,5),1,1); gbl.addLayoutComponent(jb,gbc1);
    In regards to the above code, which one of the following indicates jb's grid position?
    Choice 3 Grid position 1, 1
    Question 12
    Which one of the following is necessary when changing an Applet to a standalone application?
    Choice 1 Add a no-argument constructor.
    Choice 2 Remove the init(), start() and stop() methods.
    Choice 3 Remove "extends JApplet" or "extends Applet".
    Choice 4 Add a main() method.
    Choice 5 Change the import statement so that it imports an Application container rather than Applet or JApplet.
    mmm. not a good choice of answers. look at the following link...
    http://forum.java.sun.com/thread.jsp?forum=57&thread=218096
    Question 13.
    Which one of the following adds the String "Java" to the JComboBox jcb?
    Choice 5 jcb.addItem("Java");

  • What are the basic steps for creating a content repository?

    I am trying to create a document store on a file system (fsdb) that will hold files that are ftp's to that location. Is this possible using KM? If so, what are the basic steps for creating a file system repository and using it through KM? I have found stuff on help.sap.com but that only tells you what each component does not what actual steps need to be taken to setup KM, such as user rights , creating an entry point, so that all of KM is not visible, etc...
    If anyone knows of any guides that show a step by step process that would be great too.
    Thanks
    Paul

    Hi Paul
    First of all you need to create a new repository
    Suppose you want to add all the documents under folder Paul under C: Drive
    (Even you can put whole documents of C: drive into Paul)
    Navigate to System Admin -> System Configuration -> Knowledge management -> Content Management -> Repository Manager -> File System Repository
    There you can create a new directory by clicking on button New
    Give the parameters as follows :-
    Name               :           Anything you like
    Description       :           Anything you want
    Prefix (must start with /)  :  Probably same as your repository name like \Paul
    Lookup mode : caseless
    Root Directory   :  C:\Paul
    NOTE:  This is the trick. You need to give the proper path means folder path which you want use as repository)
    Repository Services  :  Any services you want
    Property Search : Managercom.sapportals.wcm.repository.manager.generic.search.SimplePropertySearchManager
    Security Manager         :           AclSecurityManager
    ACL Manager Cache   :           ca_cm_rep_acl
    The save it
    Now see whether the same repository is coming under KM Content or not, if not may be after restart it will come.
    I think the above information will help you. If still you have problem, please feel free to contect me.
    Regards,
    Chamkaur

  • What are the different steps to follow in order to develop an application and deploy it into a PAC

    Hi,
    I developped a program on my computer but in order to deploy it in a PAC , I don't know what are the different steps to follow?
    What are the difference between a stand alone application and communication with server mode.
    Can the file which will be downloaded into the PAC be in a form othre than (.exe). 
    what does the deployment licence consist of??? is it a software? 
    if the file is .exe then how to maintain it?
    Thank you for all,
    Regards

    Hi!
       Since I'm familiar with FieldPoint PACs, I'll refer to that (but maybe it is similar for cRIO...).
       An embedded application (standalone), runs entirely and independently on the PAC, while if you're not doing this, you'll have your computer, with LabView, which is controlling the PAC.  In this mode, application is dowloaded in PAC's RAM, so when you reboot controller, application will be lost.  If you build an embedded application, you can provide for application to boot authomatically at boot, each time the PAC reboots.  These are some basic stuffs on embedded applications with LV.
        To deploy an application to a PAC, you need LabVIEW + Real-Time module. Without it, you can't build an embedded application on PACs.
        usually, the file dowloaded is an .exe, and some libraries.  What would you like to have, exactly? For example, I think you can buy a simple .exe, which is universal, which loads VIs dinamically, so you can download directly VIs, but I've never tried this way....
       Deployment license, I think, refer to PCs, id est, when you use a PC or PXI as embedded target, in PACs, you have it bundled (it seems to me) whit the PAC you buy, so you don't have to buy an extra license for every PAC you ship with your application.  Otherwise, if you develop a Real-Time application for a PC, you will ship PC + OS licensed + Real-Time extension licensed, but this is not your case, since you'll use PACs.
       The maintain problem... I've already faced with! Simply, for my needs it was enough to make an application which loads configuration files, depending on different task the controller has to do. If you have to dowload a completely new version of VI.... it's better to deploy new application from LV.  But maybe you can bypass this problem with dinamic VIs loading...
        Let me know if this help.... Have a nice day!
    graziano

  • What are the relevent steps to take in tracking a lost iphone 5 taking into account that the battery was dead at the time

    What are the relevent steps to take in tracking a lost iphone 5 taking into account that the battery was dead at the time

    You would have neede to have "Find my phone" activated on the iphone
    Log into icloud https://www.icloud.com/  and track.

  • What are the key steps & order to follow: changes in my flat file structure

    HI,
    I have a Cube which sits on ODS.
    In the ODS,  the are 6 characterisics: Char1, Char2,...., char6; and 3 key figures: kf1, kf2, and kf3.
    The ODS is loaded through a flat file.
    Through an update rule and startup routine, the ODS updates the cube.
    Now, I have a new requirement to add 2 new characteristics (Cha10, char20) and one 2 key figures (KF55, KF66)).i.e. the flat file will now be coming in with these new fields.
    I have an idea but this this is the first time I really have to implement, I need to be sure.
    What are the key steps that I need to go through and in what order?
    Thanks

    What version are you running ?
    Will you need to load history data as for these new fields or is it just going forward ?
    Is it all one to one mapping for the new fields ?
    1. Make sure you know to what dimensions you need to add the new chars ? New dimension for these two ?
    2. New chars to be made keyfields ?
    3. Update Type for keyfigures Overwrite or Additive ?
    Enhance the Cube, DSO, change  TRFN/TR/UR..

  • Once I receive my Network Access Code(N.A.C.) for iphone 5 what are the next steps I follow to unlock my phone from vodafone to use on another network???

    Once I recieve my Network Access Code(NAC) for my iPhone 5, what are the next steps I follow to unlock it from vodafone to use on another network???
    I have my other nano sim ready and waiting to port my number to it, but im just waiting on vodafone to email me the NAC code, which i checked up that I was eligible for!!!

    Ok many thanks for telling me this BUT 1 last thing, once vodafone get back to me then is it just a matter of plugging my iphone into itunes and letting it sync? Like will a message be displayed or anything on screen letting me know or confirming that the phone has been unlocked...???

Maybe you are looking for

  • Problems on Linux

    I am running redhat 8. When I start the domain I have an interesting problem. Issue #1 I run asadmin start-domain --domain domain1 and I get the following error but both admin-server and server instance are actually running. Could not start the insta

  • Is there a full text mode in Java?

    Hi everyone. I'd like to write a java application for running exclusively on the command line. I know how to use system.out for printing basic texts, but i'd like to have a greater control over the output. I need just to clear the terminal window in

  • Reformat Problem on Jdeveloper 11.1.2.0.0 (11gR2)

    Hi All, I am using the Jdeveloper 11.1.2.0.0. I am trying below option in Jdeveloper 11.1.2.0.0. Tools --> Preference -->Code Editor --> Code Style -->Right side Edit Buuton --> Naming Tab -->Parameter Prefix --> p Above option when ill reflect into

  • Playback jumping to beginning after reaching end of sequence

    When playing a sequence, when the cursor gets to the end it now jumps to the very beginning of the sequence. It didn't used to do that, so some sort of option must have been turned on. How can I turn that option off? Thanks, John Link

  • SP 14 problem...

    hello alll... i hav upgraded to sp14 and facing few problems with it...like im not able to see any adapters in Adapter monitoring ( let they be used or not)...no adapters r displayed at all...and ofcous, im not able to run any of my scenarios... is t