Sharing objects using the shareable interface

I'm working on a key server-client applet on a Java Card, and have a question.
The server applet has admin rights and is reponsible for creating keys, i.e. the server creates all key objects. The client applets will only have access, via the shareable interface, to the verify methods of the key objects.
My question is: Is it possible to get a shareable interface to an already created object, in this case multiple key objects created by the server applet?
Thank alot.
Jonas Nilsson

If they are a part of the same package you can access the objects within the same context. You won't need to implement shareable interfaces if that were the case.
If not, just implement the shareable interface for the objects you want to share out.
BUT,
I'm not to sure you want to share key objects. Just pass that authentication was properly done and leave it at that.

Similar Messages

  • Hi,using the COM interface how do you get/set

    Hi, using the COM Interface how do you get/set the Keep iTunes Music Folder Organised options, I cant seem to find it in the help. Secondly if I have the location of a file and the Track DatabaseId, is there any way to get get the IITrack object that relates to the location. As far as I can see the Search method only allows searching on artist/abum,title,composer , and GetITObjectByID() reuires both the track database id and the track in playlist id ,and I only have the first.
    Thanks for any help Paul

    Yes, I brute force my way through it. I analyzed the file before and after a preference change to find the data changed. FYI, the "data" portion of the iTunesPrefs.xml file appears to be Base64-encoded. Strings are UTF8.
    If you want more support from apple, you would probably need to buy an higher-level ADC account.
    You can also try submitting an enhancement request through http://bugreport.apple.com (requires at least a free ADC Online account)

  • Sharing objects in the same package (context)

    Hi,
    I need a small example or API invocations which shows object sharing beetween two applets in the same package.
    Thanks.

    Look at the JavaPurse sample. You'll see the record, ParameterFile, and CyclicFile are shared objects in the same context.

  • Using the FilenameFilter interface to get the extension of a file

    Hello...
    I am trying to write a java program which is going to parse multiple xml documents and load them into the db. In a directory, there could be files other than xml files. Hence, i want to parse only files which have an .xml extension. I am using the FilenameFilter interface to get the extension of the files in a particular directory. However i am getting confused with the way it shd work...i am attaching herewith the code ...pl help me. I would appreciate if u could send me some sample code.
    /* Author : Jayashree */
    import com.xhive.XhiveDriverFactory;
    import com.xhive.error.XhiveException;
    import com.xhive.core.interfaces.XhiveTransactionIf;
    import com.xhive.dom.interfaces.XhiveDocumentIf;
    import com.xhive.core.interfaces.XhiveDatabaseIf;
    import com.xhive.core.interfaces.XhiveConnectionIf;
    import com.xhive.dom.interfaces.XhiveLibraryIf;
    import org.w3c.dom.Document;
    import java.io.*;
    public class MultiXML
    public static void main(String args[])
    try
    String administratorName = "Administrator";
    String administratorPassword = "secret";
    String DBName = "FirstDB";
    XhiveConnectionIf fConnection = XhiveDriverFactory.getDriver().getConnection();
    System.out.println("Got the connection");
    fConnection.connect(administratorName,administratorPassword,DBName);
    System.out.println("Connected");
    XhiveTransactionIf fTrans = fConnection.createTransaction();
    System.out.println("Transaction");
    fTrans.begin();
    System.out.println("Transaction begun");
    XhiveDatabaseIf fDBase = fTrans.getDatabase();
    String DBName1 = fDBase.getName();
    System.out.println(DBName1);
    XhiveLibraryIf rootLibrary = fDBase.getRoot();
    System.out.println("Got the root");
    File fDir = new File("e:/xhive");
    File[] files = fDir.listFiles(new FileFilter("xml"));
    int i = 0;
    while ((i < files.length))
    Document fDoc = null;
    System.out.println("Document Initialized");
    try
    fDoc = rootLibrary.parseDocument(new File(files[i]+".xml").toURL(), XhiveLibraryIf.PARSER_NO_VALIDATION);
    rootLibrary.appendChild(fDoc);
    System.out.println("Appended");
    catch (Exception e)
    e.printStackTrace();
    i++;
    fTrans.commit();
    System.out.println("Committed");
    fTrans.terminate();
    System.out.println("Terminated");
    fConnection.close();
    System.out.println("Connection Closed");
    catch(Exception e)
    System.out.println(e.getMessage());
    In the above code, I am trying to list all those files which have the filter as .xml. I am unable to understand what code i need to write in the accept method of the FilenameFilter interface which accepts the directory name and the file name. There could be a directory which consists of multiple xml files too..this is where i am finding a problem
    Regards,
    Jayashree

    This sample code uses an inner anonymous FilenameFilter that takes all readable files with a ".xml" extension.
    File[] fileList = dir.listFiles (new FilenameFilter () {
        public boolean accept (File dir, String name) {
            if (!name.trim().endsWith (".xml"))
                return false;
            File f = new File (dir, name);
            if (!f.isFile())
                return false;
            if (!f.canRead())
                return false;
            return true;
    });Please post any question if you don't understand.
    Matthieu

  • How do i pass a daqmx task from labview to matlab using the math interface toolkit?

    I want to use DAQMX functions from Matlab using the Math Interface Toolkit (MIT). How can I have a labview function output (return) the DAQMX task to matlab via the MIT?
    I want to do this so I can start a DAQMX task in Labview from a matlab function and return control to matlab without losing the task.

    Hi Mark,
    (I already posted this answer in your other thread, but let's keep THIS thread alive - it makes more sense here in the LabVIEW forum than in Instrument Control forum.)
    Since the DAQmx Task is not a native data type that can be passed directly to MATLAB from LAbVIEW, try flattening the DAQmx Task to a string before passing to MATLAB. However, I doubt that you can access the task from within MATLAB, but feel free to give it a try.
    Good luck!
    - Philip Courtois, Thinkbot Solutions

  • In Camera Raw 8.4.1 I can open dngs from 3 years ago, but it's using the old interface and functionality not the current - how do I change this. Have rebuilt cache.

    Running Creative Cloud on an HP with 18Gb Ram - I'm working on a project using 3 yr old dngs and when I open in my up to date Camera Raw it uses the old interface with 'contrast' towards the bottom and 'recovery' below 'exposure' - how do I get Camera Raw to open with the current interface?
    Thanks for any help.
    Craig

    If you're referring to the Process version, you set that in the Camera Calibration tab of ACR.
    Also keep in mind that any images with prior adjustments will show the Process used when they were adjusted.  That can also be changed in that tab.

  • Using the Mathcad Interface, my worksheet won't recognize the data as numbers

    While using the Mathcad Interface Library, I've written a 2D Matrix, but although the Mathcad Worksheet does display the data, it won't recognize it as numbers, hence I can't do any operations with it. However, if I declare the very same matrix in mathcad, my worksheet works fine. What can I do?

    Hi ali84, did you tried using the examples that are in the library? Do you get the same error? Could you post your code to see how you are sending the data?
    If manually defining the worksheet as numbers will make your program work, you could use directly the VIs for Active X and change the properties directly
    http://zone.ni.com/devzone/cda/tut/p/id/2983
    Best Regards
    Benjamin C
    Senior Systems Engineer // CLA // CLED // CTD

  • Aironet 1240AG - cant use the web interface

    I am trying to configure a new Aironet 1240AG. After it picked an ip address from the DHCP in my lan, I still can't log in using the web interface. I am using an Internet Explorer 6.0 on Win 2000. It keeps telling me cannot find server. please i need assistance

    Hi Obinna,
    Sorry about the link :( The problem here is the fact that 12.3.(11)JX is a Lightweight image. Have a look;
    Warning: All Cisco Aironet Access Points receiving Cisco IOS Software Release 12.3(11)JX will only function in conjunction with a Cisco Wireless LAN Controller. They will no longer be able to function as Cisco Aironet Autonomous Access Points.
    This product bulletin describes the content and delivery information for Cisco IOS Software Release 12.3(11)JX. This is a Cisco Lightweight Access Point Protocol (LWAPP) upgrade and recovery support software image supporting Cisco Aironet 1100, Aironet 1130, Aironet 1200, Aironet 1230 AG, Aironet 1240 AG, and Aironet 1300 Series Access Points.
    http://www.cisco.com/en/US/products/ps5861/prod_bulletin0900aecd804b1a72.html
    You can use this method to convert the AP back to Autonomous Mode (and access via Web);
    Reverting the Access Point Back to Autonomous Mode
    http://www.cisco.com/en/US/products/hw/wireless/ps430/prod_technical_reference09186a00804fc3dc.html#wp161272
    You can convert an access point from lightweight mode back to autonomous mode by loading a Cisco IOS Release that supports autonomous mode (Cisco IOS release 12.3(7)JA or earlier). If the access point is associated to a controller, you can use the controller to load the Cisco IOS release. If the access point is not associated to a controller, you can load the Cisco IOS release using TFTP.
    Using a TFTP Server to Return to a Previous Release
    Follow these steps to revert from LWAPP mode to autonomous mode by loading a Cisco IOS release using a TFTP server:
    Step 1 The static IP address of the PC on which your TFTP server software runs should be between 10.0.0.2 and 10.0.0.30.
    Step 2 Make sure that the PC contains the access point image file (such as c1200-k9w7-tar.122-15.JA.tar for a 1200 series access point) in the TFTP server folder and that the TFTP server is activated.
    Step 3 Rename the access point image file in the TFTP server folder to c1200-k9w7-tar.default for a 1200 series access point, c1130-k9w7-tar.default for an 1130 series access point, and c1240-k9w7-tar.default for a 1240 series access point.
    Step 4 Connect the PC to the access point using a Category 5 (CAT5) Ethernet cable.
    Step 5 Disconnect power from the access point.
    Step 6 Press and hold MODE while you reconnect power to the access point.
    Step 7 Hold the MODE button until the status LED turns red (approximately 20 to 30 seconds) and then release.
    Step 8 Wait until the access point reboots, as indicated by all LEDs turning green followed by the Status LED blinking green.
    Step 9 After the access point reboots, reconfigure it using the GUI or the CLI.
    From this doc;
    http://www.cisco.com/en/US/products/hw/wireless/ps430/prod_technical_reference09186a00804fc3dc.html#wp161272
    Hope this helps!
    Rob

  • Could not use the math interface toolkit

    I have labview 8.0....and i am unable to use the math interface kit it provided....please help..

    swap,
    You are correct that the Math Interface Tookit 1.0 is not compatable with LabVIEW 8.0, which probably exlains why you are seeing an error.  You may have already seen this knowledgebase.  As suggested in the knowledgebase, you can get version 1.0.2 by visiting the Upgrade Advisor.  You can also contact your local NI sales representative.
    Chris M

  • Importing form data per XML - Using the form interface?

    Hi!
    I'm developing interactive forms by adobe and I want to import my form data per XML file. The xml file and the email are created by my pdf document.
    Now this xml file has to be parsed by a report or something like this.
    Is it possible to use the form interface, I implemented, or do I have to parse it manually?
    I think it has to work with this interface because it makes the pdf and it "knows" what to import/export.
    Am I wrong with my suspicions or can you help me with this problem?
    Thanks & greets,
    Philip Gillißen

    I'm pretty impressed of Adobe and their stuff (I do NOT refer to the community), how helpful they are.
    Perhaps I didn't understand  the meaning on the offical customer support website, stating:
    The best way to contact us...  
    Ask our experts 
    Our community and staff are at your service 24/7
    Even worst, their is a similar question from 25/09/2013 (http://forums.adobe.com/message/5711946#5711946) and no feedback form Adobe stuff at all.
    Great service guys!
    Thanks a lot!

  • Problem in using the Unreferenced interface

    I let my RemoteObject to implement the Unreferenced interface to handle with the unexpectly abort client. but I have a question about how to use such interface in my remote object.
    My first thought about it is simple :
    class RemoteObject extends UnicastRemoteObject implements Unreferenced {
        public long lock(final int recno) {
            this.lockedRecNo = recno;
            this.lockCookie = LockManager.getInstance().lock(recno);
            return lockcookie;
        public void unreferenced() {
            this.unlock(this.lockedRecNo, this.lockCookie);
    }I think it is absolutely wrong under such scenario, since the unreference does not take effect immediately and we surely have only one RemoteObject, during this time. someother client may lock on other records, When performing the unreferenced, we may work on the incorrect record number and cookie.
    Then I improved it as
    class RemoteObject extends UnicastRemoteObject implements Unreferenced {
        private HashMap lockedRecord = new HashMap();
        public long lock(final int recno) {
            this.lockedRecNo = recno;
            this.lockCookie = LockManager.getInstance().lock(recno);
            lockedRecord.put(new Integer(recno), new Long(lockCookie))
            return lockcookie;
        public void unlock(final int recno, final int cookie) {
            LockManager.getInstance().unlock(recno, cookie);
            lockedRecord.remove(new Integer(recno));
        public void unreferenced() {
            //get all that haven't released lock from the HashMap
            //do a loop
            **loop** {
            this.unlock(this.lockedRecNo, this.lockCookie);
        }There are still some problems. maybe when we are executing the unreference, there is a client who are holding a lock and doing the update action, then we may wrongly release his lock.
    I can not figure out a good enough way to handle this. can any one help me on this. thx in advance.

    Hi.. Actually, it is not part of the[b] real world problem, I just want to provide a way to clean up the staleness record. If considering this. do you guys thing the approach 2 of the first posting is a way(maybe not a good way), except I should change the hashmap to hashtable to avoid the concurrent accessing... appreciate for any reply from u.

  • Read records from VALUES OBJECT using the INTERATOR

    Hi
    I'm trying to read records from my value object with interator these way:
    ValidaUsu usuVO = new ValidaUsu();
    for (Iterator it = usuVO it.hasNext(); ) {
    System.out.println(" User from VO: " + usuVO.getUsuario());
    But i don't know what i`m doing wrong ?
    Could help me?
    Thanks

    Hi Gajendra,
    You can mainly read records from MDM (in a DDIC structure) using ABAP API's using the following function modules/methods:
    1. RETRIEVE: This is used to generically retrieve records from tables. Attributes and Values can also be retrieved.
    2. RETRIEVE SIMPLE: Retrieve records from MDM in a simple way.( simple data types).
    3. RETRIEVE CHECKOUT: Retrieves all checked out ID's.
    4. RETRIEVE ATTRIBUTES: Retrieves attribute(s) from a Taxanomy table.
    You will find all these methods in the following interface
    Interface : IF_MDM_CORE_SERVICES
    Hope it helps.
    *Please reward points if found useful.
    Thanks and Regards
    Nitin Jain

  • Using the Comparator Interface.Please Help.

    Hello there,
    I am trying out this example regarding the Comparator Interface.
    It works fine, but I havent really understood this at all.
    It deals with reverse sorting.
    import java.util.*;
    class MyComp implements Comparator {
    public int compareTo(Object a,Object b)
    String aStr,bStr;
    aStr = (String)a;
    bStr = (String)b;
    return bStr.compareTo(aStr)
    class MyComparator {
    public static void main(String[] args) {
    // Create a Tree Set
    TreeSet ts = new TreeSet(new MyComp());
    ts.add("C");
    ts.add("A");
    ts.add("P");
    ts.add("Z");
    ts.add("B");
    System.out.println(ts)
    Output : [Z, P, C, B, A]
    I have not understood the following at all:
    1) We are implementing the Comparator Interface in class MyComp.
    Now where is this being called in the MyComparator class?
    2) How is the reverse sorting taking place.?
    How is this comparing the different instances of the MyComparator class
    when I havent even instantiated the MyComparator class ?
    3) How is the interface method compare To(Object a,Object b) being invoked?
    Please can some please answer my questions.
    Regards

    class MyComp implements Comparator {
    public int compareTo(Object a,Object b)
    String aStr,bStr;
    aStr = (String)a;
    bStr = (String)b;Your reverse ordering is happening here.
    If you were to write
    return aStr.compareTo(bStr)
    the ordering would be in normal order.
    >
    return bStr.compareTo(aStr)The comparator that the treeSet uses is declared and instantiated here
    TreeSet ts = new TreeSet(new MyComp());
    1) We are implementing the Comparator Interface in
    class MyComp.
    Now where is this being called in the MyComparator
    or class? The comparator is being used by the TreeSet to order your entries
    >
    >
    2) How is the reverse sorting taking place.?Explained above. For further explaination look up comparator and String.compareTo()
    How is this comparing the different instances of
    of the MyComparator class
    when I havent even instantiated the MyComparator
    or class ?Also explained above
    3) How is the interface method compare To(Object
    a,Object b) being invoked?Internally by the TreeSet
    I hope this helped a little

  • How to use the Comparable Interface?

    Now I have a question and I don't quite understand what the book explains. How does the comparable interface work? How can you redefine the equals implementation? How can you implement a compareTo? and how does this works with arrays? Thanks amigos......

    Not sure how to answer your question "how does the Comparable interface work" - what do you mean by "work"? It's purpose is to supply a known method that can be used to define an ordering on lists of objects. To do this you need to know how two objects compare to each other (less than, equal to, greater than) - and that's what the compareTo method gives you.
    You redefine the equals implementation by overriding the equals method - just declare a method in your class that has the same signature as equals and you're good.
    Your implementation of compareTo depends on your class. You just need to define how your classes compare to each other - for instance, assume you have an "Employee" class, that has an employee number and first name and last name fields. You want the natural ordering of lists of Employees to go in order by employee number. Define your compareTo method like:
    public int compareTo(Object o) {
        Employee emp = (Employee)o;
        if (emp.getEmployeeNumber() < this.getEmployeeNumber()) {
            return -1;
        else if (emp.getEmployeeNumber() == this.getEmployeeNumber()) {
            return 0;
        else {
            return 1;
    }You can sort arrays of things via the Arrays.sort method, which takes the array to sort and a Comparator (not Comparable) reference. The Comparator interface provides the same idea as the Comparable interface, but it's a stand-alone object that handles the comparison, as opposed to a method of some particular class. The compareTo method of the Comparator interface takes two Object references and returns how they compare.
    Good luck
    Lee

  • Stuck using the Comparable Interface

    I am having problems implementing the Comparable Interface in my class. I have written the compareTo method but this is not working. Can anyone see what I am doing wrong in the coding of this method. Thanks !!. (see below code for the class :
    package tma02q1;
    import java.util.*;
    This is the outline of the basic Video class.
    Such a class describes the videos stocked by a branch of a video hire company
    As well as completing the given methods you will need to make further additions
    to this class.For further details you should study the BranchTest class.
    public class Video implements Comparable {
    // declare two instance variables
    // a String to hold the video title
    // an int to hold the video rental cost - cost is held in pence
    private String aTitle;
    private int aCost;
    public Video(String aTitle, int aCost) {
    this.aTitle = aTitle;
    this.aCost = aCost;
    private void setTitle(String aTitle) {
    this.aTitle = aTitle;
    public String getTitle() {
    return aTitle;
    private void setRentalCost(int aCost) {
    this.aCost = aCost;
    public int getRentalCost() {
    return aCost;
    public String toString() {
    return "Video Title = " + aTitle + " which has a rental cost of = " + aCost;
    public boolean equals(Object vid) {
    Video arg = (Video) vid;
    return (this.aTitle.equals(arg.aTitle)
    &&this.aCost==arg.aCost);
    public int compareTo(Object vido) {
    Video arg = (Video) vido;
    int comp = aCost.compareTo(arg.aCost);
    return comp;

    You've got another serious problem with your code. Both the equals and compareTo methods will throw a ClassCastException if the parameter is not a reference to a video object. Using the instanceof operator will however solve the problem. E.g.
    public boolean equals(Object o) {
      if (o instanceof Video) {
        Video  arg = (Video) o;
        return (this.aTitle.equals(arg.aTitle)
                &&this.aCost == arg.aCost);
      else
        return false;  
    }The same approach is applicable to the compareTo method.
    Regards

Maybe you are looking for

  • How to modify the length of a user profile property

    I need to increase the length of a custom user profile property, but the length looks disabled when I try to edit and modify. Is there any way i could modify this by powershell or some other work around where I can increase the lenght of the script?

  • ADF and 100 tables

    Hi I'm new in ADF technology so I suppose my question is very simple. How can I create ComboBox witch have a fields with all tables in databes?? I don't wont write manually, but I want that my application read all tables from database (JDBC connected

  • Accessing a Keynote presentation on iPad

    How do I access a Keynote presentation on my iPad that I created on my MAC and saved into iCloud?

  • How to use Instant Client with JDBC?

    I unzipped all the *.zip (basic, JDBC Supplement, ODBC, SQLPlus) to a clean directory and added it to my env PATH variable. SQLPlus is working, but when I try via OCI JDBC I get: Exception in thread "main" java.lang.UnsatisfiedLinkError: t2cCreateSta

  • Report object

    hi frds plz give me clearly any critical report object plz give me with  transaction codes to my mail id <REMOVED BY MODERATOR> Edited by: Alvaro Tejada Galindo on Feb 27, 2008 5:27 PM