Understanding the Delete Applet APDU

Hello all,
I'm trying to understand each byte of the delete APDU command.
I'm using this guide as a reference: http://askra.de/software/jcdocs/kit-user-2.2.1/cJDKinstaller.html#wp8960
My delete command is the following:
80 C4 01 00 08 07 (AID - 7 sets)
Is this understanding correct? When I run the command after selecting the applet, I receive a 6D00 response, stating the command structure is not supported.
Thanks,
Collin

I see you said: When I run the command after selecting the applet, I receive a 6D00 response, stating the command structure is not supported.
you must select the security domain/cardmanager, then send the delete command

Similar Messages

  • I still don't totally understand the difference on my iPhone between PhotoStream (with iCloud icon), Photos (the icon) and Albums and Camera Roll (under Photos icon) and and Camera Roll (under Camera icon).  I want to delete photos from my iPhone 4.

    I  don’t  understand the difference on my iPhone between PhotoStream (with iCloud icon), Photos (the icon) and Albums and Camera Roll (under Photos icon) and and Camera Roll (under Camera icon).  They seem to be more or less the same thing, but deleting photos in one place does not delete them elsewhere.
    When I tried to import from my camera to my iMac computer the computer would not recognized 900 of the 920 photos on the camera so I had to (successfully) use the Image Capture application to import them.
    I want to delete photos from my iPhone 4 in order to free up storage (I only have 8GB.)  But in synching I do not want to delete any images from my iPhoto on my computer.
    Is there a way that I can Delete All under Edit in either Photos or Camera on my iPhone and check about 20 ijmages to remain on the iPhone?  I could find no command to Select All and then uncheck the 20 photos I want to keep.
    I have the 8GB iPhone and the iMac with OS 10.9.2 and iPhoto '09 Version 8.1.2.
    Help!

    I have Version 6.1.3 because the clogged storage will not allow me to upload Version 7.1.  Catch 22.  This is basically a storage issue, I believe.  I cannot delete enough stuff on my iPhone to allow me to either back up or upload the new OS 7.  I am unwilling to pay for more storage in iCloud, so I want to delete stuff I don't need.  But I haven't yet figured out how to successfully do that.  I synch my phone and computer.  I want to delete mail on the Mail app and photos and still keep my photos on my computer on iPhoto, but not on my phone.  I seem unable to do that.  Any advice?

  • TS1135 Low quality warning on a photo in a photobook. I understand the warning but I still want to go ahead with my design, will it get printed or will the page be deleted?

    Low quality warning on a photo in a photobook. I understand the warning but I still want to go ahead with my design, will it get printed or will the page be deleted?

    Sorry 1 further question please..
    the  pixel width is 1,076 and heigth is 793 and I want to have this photo as a background in a 13 x 10 inch book
    Will this be ok?
    Thanks

  • Understanding the dataadapter.delete command

    I'm new to ADO and ODP so forgive me if I'm missing the obvious. I want to do a simple delete from the database. The problem is I feel like I have to issue the delete command twice. The code I've posted blow works but I don't understand why. I create two commands one a select command the second a delete command. I apply these commands to a dataadapter and then use dataadapter .fill() to get a dataset.
    Great it works fine up to this point. The problem was when I called dataadapter.update nothing would happen. The delete command was ignored. So I looped through the resulting dataset and deleted the record from there. Then I called dataadapter.update and it worked. I tried not setting the dataadapter.deletecommand but then update failed.
    Now my question is: Is it always necessary to delete from a dataset as well as issue a delete command or is there a way of issuing just one delete command? Is it possible to simplify my code?
    Any suggestions or help greatly appreciated.
    Drew
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    Dim oradb As String = "Data Source=vulcan.world;User Id=adowling;Password=aragon;"
    Dim conn As New OracleConnection(oradb)
    Dim cmd As New OracleCommand
    Dim cmd2 As New OracleCommand
    Dim orada As New OracleDataAdapter
    Dim dsLog As New DataSet
    Dim drDelete As DataRow
    Dim myCol As DataColumn
    Dim dcPK(1) As DataColumn
    Dim i As Integer
    Dim rc As DataRowCollection
    Dim pSDEWorkspace As IWorkspaceFactory2
    Try
    conn.Open()
    cmd.Connection = conn
    cmd.CommandText = "select * from t.reconcile_log"
    cmd.CommandType = CommandType.Text
    orada.SelectCommand = cmd
    cmd2.Connection = conn
    cmd2.CommandText = "delete from t.reconcile_log where objectid = " + TextBox1.Text
    cmd2.CommandType = CommandType.Text
    orada.DeleteCommand = cmd2
    orada.Fill(dsLog, "Reconcile_Log")
    orada.MissingSchemaAction = MissingSchemaAction.AddWithKey
    myCol = dsLog.Tables("Reconcile_Log").Columns.Item(dsLog.Tables("Reconcile_Log").Columns.IndexOf("OBJECTID"))
    dcPK(0) = myCol
    dsLog.Tables("Reconcile_Log").PrimaryKey = dcPK
    drDelete = dsLog.Tables("Reconcile_Log").Rows.Find(TextBox1.Text)
    drDelete.Delete()
    orada.Update(dsLog, "Reconcile_Log")
    ListBox1.Items.Clear()
    rc = dsLog.Tables("Reconcile_Log").Rows
    For i = 0 To rc.Count - 1
    ListBox1.Items.Add(Convert.ToString(rc.Item(i).Item(0)) + " " + rc.Item(i).Item(1) + " submitted " + rc.Item(i).Item(2) + " on " + rc.Item(i).Item("submitted"))
    Next i
    Catch ex As OracleException
    Select Case ex.Number
    Case 1
    MessageBox.Show("Error attempting to insert duplicate data.")
    Case 12545
    MessageBox.Show("The database is unavailable.")
    Case 904
    MessageBox.Show("invalid type")
    Case Else
    MessageBox.Show("Database error: " + ex.Message.ToString())
    End Select
    Catch ex As Exception
    MessageBox.Show(ex.ToString)
    Finally
    conn.Close()
    conn.Dispose()
    End Try
    End Sub

    Because the dataset is disconnected from the database. This allows you to load some data (into your dataset), disconnect from the network or whatever, make whatever changes you like and have none of this affect the data in the database until you issue the update.
    If you actually want to have your changes applied immediately then you can (assuming your application is constantly connected of course). Don't bother with a dataset/data adaptor at all. For example set up the sql select statement, assign it to a reader, execute the reader, store the rows returned in some custom objects or whatever. Make some changes and then use executeNonQuery to apply the updates, either one at a time or as a batch using array binding. There is a samples folder where you installed ODP.NET, have a look at some of the others.

  • I have Mac mini and there is partition of boot camp but some miss understanding the osx 10.8.2 is deleted and while I m going to recovery mode the portition can not removing and the also cant repaired what I do I need urgent help ???? Please ?????

    I have Mac mini and there is partition of boot camp but some miss understanding the osx 10.8.2 is deleted and while I m going to recovery mode the portition can not removing and the also cant repaired what I do I need urgent help ???? Please ?????

    Do you have a Time Machine backup or clone?  If not,
    all is lost if you have in fact deleted your OSX partition
    and you will have to do a reinstall from Recovery HD
    and install all else.

  • How do I delete an exception made by clking "I understand the risk?"

    Was going to new website and got the untrusted message and accidentally click "I understand the risk." How to I reverse this? I do NOT trust this site.

    hi robinandjon, you can undo that when you go into the ''menu > options > advanced > certificates > view certificates > servers'' tab and delete the cert of the site in question.

  • Unable to delete applet.....

    Hi all,
    I am unable to delete one applet which I have loaded in the card.
    There are 2 applets, one is purse and other is loyalty. And am using shareable interface in which loyalty is the server and purse is the client. I can delete the purse applet but i can't delete the loyalty from the card.
    Here is my code : There are in all 3 codes, one is purse, second is loyalty code and third is the shareable interface code. Can some one look at the code and tell me what's wrong in this programs.
    package com.gemplus.examples.loyalty;
    import javacard.framework.*;
    import visa.openplatform.*;
    public class Loyalty extends javacard.framework.Applet implements TestInterface
    static byte points ;
    protected Loyalty(byte[] buffer, short offset, byte length)
    // data offset is used for application specific parameter.
    // initialization with default offset (AID offset).
    short dataOffset = offset;
    if(length > 9) {
    // Install parameter detail. Compliant with OP 2.0.1.
    // | size | content
    // |------|---------------------------
    // | 1 | [AID_Length]
    // | 5-16 | [AID_Bytes]
    // | 1 | [Privilege_Length]
    // | 1-n | [Privilege_Bytes] (normally 1Byte)
    // | 1 | [Application_Proprietary_Length]
    // | 0-m | [Application_Proprietary_Bytes]
    // shift to privilege offset
    dataOffset += (short)(1 + buffer[offset]);
    // finally shift to Application specific offset
    dataOffset += (short)(1 + buffer[dataOffset]);
    // checks wrong data length
    if(buffer[dataOffset] != 4)
    // return received proprietary data length in the reason
    ISOException.throwIt((short)(ISO7816.SW_WRONG_LENGTH + offset + length - dataOffset));
    // go to proprietary data
    dataOffset++;
    // points = 0;
    // register this instance
    register(buffer, (short)(offset + 1), (byte)buffer[offset]);
    * Method installing the applet.
    * @param bArray the array constaining installation parameters
    * @param bOffset the starting offset in bArray
    * @param bLength the length in bytes of the data parameter in bArray
    public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException
    /* applet instance creation */
    new Loyalty (bArray, bOffset, (byte)bLength);
    * Select method returning true if applet selection is supported.
    * @return boolean status of selection.
    public boolean select()
    /* return status of selection */
    return true;
    * Deselect method.
    public void deselect()
    return;
    public void process(APDU apdu) throws ISOException
              // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
              ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
                   apdu.setIncomingAndReceive();
              byte[] apduBuffer = apdu.getBuffer();
    // writes the balance into the APDU buffer after the APDU command part
              creditPoints((byte)0x00);     
              apduBuffer[5] = (byte)(points >> 8) ;
              apduBuffer[6] = (byte)points ;
    // sends the APDU response
    // switches to output mode
              apdu.setOutgoing() ;
    // 2 bytes to return
              apdu.setOutgoingLength((short)2) ;
    // offset and length of bytes to return in the APDU buffer
              apdu.sendBytes((short)5, (short)2) ;
         public void creditPoints(byte pTobeCredited)
    points += pTobeCredited;
    public Shareable getShareableInterfaceObject(AID client, byte param){
              if(param != (byte)0x00)
                   return null;
         return (this);
    second code is :
    package com.gemplus.examples.oppurse;
    * Imported packages
    import javacard.framework.*;
    import visa.openplatform.*;
    import com.gemplus.examples.loyalty.*;
    public class OPPurse extends javacard.framework.Applet
    // the APDU constants for all the commands.
         private final static byte INS_GET_BALANCE = (byte)0x30 ;
         private final static byte INS_DEBIT      = (byte)0x31 ;
         private final static byte INS_CREDIT      = (byte)0x32 ;
         private final static byte INS_VERIFY_PIN = (byte)0x33 ;
         private final static byte INS_SET_NAME                    = (byte)0x34 ;
         private final static byte INS_GET_NAME                    = (byte)0x35 ;
    // the OP/VOP specific instruction set for mutual authentication
         private final static byte CLA_INIT_UPDATE = (byte)0x80 ;
         private final static byte INS_INIT_UPDATE = (byte)0x50 ;
         private final static byte CLA_EXTERNAL_AUTHENTICATE = (byte)0x84 ;
         private final static byte INS_EXTERNAL_AUTHENTICATE = (byte)0x82 ;
    // the PIN validity flag
    private boolean validPIN = false;
    // SW bytes for PIN Failed condition
         // the last nibble is replaced with the number of remaining tries
         private final static short      SW_PIN_FAILED = (short)0x63C0;
         private final static short SW_FAILED_TO_OBTAIN_SIO = (short)0x63D0;
         private final static short SW_LOYALTY_APP_NOT_EXIST = (short)0x63E0;
    // the illegal amount value for the exceptions.
    private final static short ILLEGAL_AMOUNT = 1;
    // the maximum balance in this purse.
    private static final short maximumBalance = 10000;
    // the current balance in this purse.
    private static short balance;
    /*     byte[] loyaltyAID = new byte[]{ (byte)0xA0,(byte)0x00,(byte)0x00,(byte)0x00,
              (byte)0x19,(byte)0xFF,(byte)0x00,(byte)0x00,
              (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,
              (byte)0x00,(byte)0x00,(byte)0x02,(byte)0x02};*/
    /* Security part of declarations */
    // the Security Object necessary to credit the purse
    private ProviderSecurityDomain securityObject = null;
    // the security channel number
    byte secureChannel = (byte)0xFF;
    // the authentication status
    private boolean authenticationDone = false;
    // the secure channel status
    private boolean channelOpened = false;
         private byte[] nameBuffer = new byte[6];
    * Only this class's install method should create the applet object.
    protected OPPurse(byte[] buffer, short offset, byte length)
    // data offset is used for application specific parameter.
    // initialization with default offset (AID offset).
    short dataOffset = offset;
    if(length > 9) {
    // Install parameter detail. Compliant with OP 2.0.1.
    // | size | content
    // |------|---------------------------
    // | 1 | [AID_Length]
    // | 5-16 | [AID_Bytes]
    // | 1 | [Privilege_Length]
    // | 1-n | [Privilege_Bytes] (normally 1Byte)
    // | 1 | [Application_Proprietary_Length]
    // | 0-m | [Application_Proprietary_Bytes]
    // shift to privilege offset
    dataOffset += (short)( 1 + buffer[offset]);
    // finally shift to Application specific offset
    dataOffset += (short)( 1 + buffer[dataOffset]);
    // checks wrong data length
    if(buffer[dataOffset] != 2)
    // return received proprietary data length in the reason
    ISOException.throwIt((short)(ISO7816.SW_WRONG_LENGTH + offset + length - dataOffset));
    // go to proprietary data
    dataOffset++;
    } else {
    // Install parameter compliant with OP 2.0.
    if(length != 2)
    ISOException.throwIt((short)(ISO7816.SW_WRONG_LENGTH + length));
              // retreive the balance value from the APDU buffer
    short value = (short)(((buffer[(short)(dataOffset + 1)]) & 0xFF)
              | ((buffer[dataOffset] & 0xFF) << 8));
    // checks initial balance value
    if(value > maximumBalance)
    ISOException.throwIt(ISO7816.SW_DATA_INVALID);
              // initializes the balance with the APDU buffer contents
    balance = value;
    // register this instance as an installed Applet
    register();
    // ask the system for the Security Object associated to the Applet
    securityObject = OPSystem.getSecurityDomain();
    // applet is personalized and its state can change
    OPSystem.setCardContentState(OPSystem.APPLET_PERSONALIZED);
    // build the new ATR historical bytes
    byte[] newATRHistory = new byte[]
    // put "OPPurse" in historical bytes.
    (byte)0x4F, (byte)0x50, (byte)0x50, (byte)0x75, (byte)0x72, (byte)0x73, (byte)0x65
    // !!! ACTIVATED IF INSTALL PRIVILEGE IS "Default Selected" (0x04). !!!
    // change the default ATR to a personalized's one
    OPSystem.setATRHistBytes(newATRHistory, (short)0, (byte)newATRHistory.length);
    * Method installing the applet.
    * @param installparam the array constaining installation parameters
    * @param offset the starting offset in installparam
    * @param length the length in bytes of the data parameter in installparam
    public static void install(byte[] installparam, short offset, byte length )
    throws ISOException
    // applet instance creation with the initial balance
    new OPPurse(installparam, offset, length );
    * Select method returning true if applet selection is supported.
    * @return boolean status of selection.
    public boolean select()
    validPIN = false;
    // reset security if used.
    // In case of reset deselect is not called
    reset_security();
    // return status of selection
    return true;
    * Deselect method.
    public void deselect()
    // reset security if used.
    reset_security();
    return;
    * Method processing an incoming APDU.
    * @see APDU
    * @param apdu the incoming APDU
    * @exception ISOException with the response bytes defined by ISO 7816-4
    public void process(APDU apdu) throws ISOException
    // get the APDU buffer
    // the APDU data is available in 'apduBuffer'
    byte[] apduBuffer = apdu.getBuffer();
    // the "try" is mandatory because the debit method
    // can throw a javacard.framework.UserException
    try
         switch(apduBuffer[ISO7816.OFFSET_INS])
    case INS_VERIFY_PIN :
         verifyPIN(apdu);
    break ;
    case INS_GET_BALANCE :
         getBalance(apdu) ;
    break ;
    case INS_DEBIT :
         debit(apdu) ;
    break ;
                        case INS_SET_NAME :
                             setName(apdu);
                        break;
                        case INS_GET_NAME :
                             getName(apdu);
                        break ;
    case INS_CREDIT :
         credit(apdu) ;
    break ;
    case INS_INIT_UPDATE :
    if(apduBuffer[ISO7816.OFFSET_CLA] == CLA_INIT_UPDATE)
    // call initialize/update security method
         init_update(apdu) ;
    else
    // wrong CLA received
    ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
    break ;
    case INS_EXTERNAL_AUTHENTICATE :
    if(apduBuffer[ISO7816.OFFSET_CLA] == CLA_EXTERNAL_AUTHENTICATE)
    // call external/authenticate security method
         external_authenticate(apdu) ;
    else
    // wrong CLA received
    ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
    break ;
    case ISO7816.INS_SELECT :
    break ;
    default :
    // The INS code is not supported by the dispatcher
         ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED) ;
    break ;
         }     // end of the switch
    } // end of the try
              catch(UserException e)
    // translates the UserException in an ISOException.
              if(e.getReason() == ILLEGAL_AMOUNT)
    throw new ISOException ( ISO7816.SW_DATA_INVALID ) ;
    //- P R I V A T E M E T H O D S -
         * Handles Verify Pin APDU.
         * @param apdu APDU object
         private void verifyPIN(APDU apdu)
    // get APDU data
              apdu.setIncomingAndReceive();
    // get APDU buffer
    byte[] apduBuffer = apdu.getBuffer();
    // check that the PIN is not blocked
    if(OPSystem.getTriesRemaining() == 0)
    OPSystem.setCardContentState(OPSystem.APPLET_BLOCKED);
    // Pin format for OP specification
    // |type(2),length|nible(1),nible(2)|nible(3),nible(4)|...|nible(n-1),nible(n)|
    // get Pin length
    byte length = (byte)(apduBuffer[ISO7816.OFFSET_LC] & 0x0F);
    // pad the PIN ASCII value
    for(byte i=length; i<0x0E; i++)
    // only low nibble of padding is used
    apduBuffer[ISO7816.OFFSET_CDATA + i] = 0x3F;
    // fill header TAG
    apduBuffer[0] = (byte)((0x02 << 4) | length);
    // parse ASCII Pin code
    for(byte i=0; i<0x0E; i++)
    // fill bytes with ASCII Pin nibbles
    if((i & 0x01) == 0)
    // high nibble
    apduBuffer[(i >> 1)+1] = (byte)((apduBuffer[ISO7816.OFFSET_CDATA + i] & 0x0F) << 4);
    else
    // low nibble
    apduBuffer[(i >> 1)+1] |= (byte)(apduBuffer[ISO7816.OFFSET_CDATA + i] & 0x0F);
    // verify the received PIN
    // !!! WARNING PIN HAS TO BE INITIALIZED BEFORE USE !!!
    if(OPSystem.verifyPin(apdu, (byte)0))
    // set PIN validity flag
    validPIN = true;
    // if applet state is BLOCKED then restore previous state (PERSONALIZED)
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
    OPSystem.setCardContentState(OPSystem.APPLET_PERSONALIZED);
    return;
         // the last nibble of returned code is the number of remaining tries
              ISOException.throwIt((short)(SW_PIN_FAILED + OPSystem.getTriesRemaining()));
    * Performs the "getBalance" operation on this counter.
    * @param apdu The APDU to process.
    private void getBalance( APDU apdu )
    // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
                   ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
    // get the APDU buffer
    byte[] apduBuffer = apdu.getBuffer();
    // writes the balance into the APDU buffer after the APDU command part
              apduBuffer[5] = (byte)(balance >> 8) ;
              apduBuffer[6] = (byte)balance ;
    // sends the APDU response
    // switches to output mode
              apdu.setOutgoing() ;
    // 2 bytes to return
              apdu.setOutgoingLength((short)2) ;
    // offset and length of bytes to return in the APDU buffer
              apdu.sendBytes((short)5, (short)2) ;
         private void setName(APDU apdu)
              // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
                   ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
              // the operation is allowed only if master pin is validated
         if(!validPIN)
    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
              byte[] apduBuffer = apdu.getBuffer();
              apdu.setIncomingAndReceive();     
              for(short i=0,k=5;i<6;i++,k++)
                   nameBuffer[i] = apduBuffer[k];
         }//end of setName
         private void getName(APDU apdu)
              // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
                   ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
                   byte[] apduBuffer = apdu.getBuffer();
                   for(short i=5, k=0;i<11;i++,k++)
                        apduBuffer=nameBuffer[k];
                   apdu.setOutgoing();
                   apdu.setOutgoingLength((short)6);
                   apdu.sendBytes((short)5,(short)6);
         }//end of storeName
    * Performs the "debit" operation on this counter.
    * @param apdu The APDU to process.
    * @exception ISOException If the APDU is invalid.
    * @exception UserException If the amount to debit is invalid.
    private void debit(APDU apdu) throws ISOException, UserException
    // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
                   ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
    // the operation is allowed only if master pin is validated
         if(!validPIN)
    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
    // get the APDU buffer
    byte[] apduBuffer = apdu.getBuffer();
         // Gets the length of bytes to recieved from the terminal and receives them
    // If does not receive 4 bytes throws an ISO.SW_WRONG_LENGTH exception
              if(apduBuffer[4] != 2 || apdu.setIncomingAndReceive() != 2)
              ISOException.throwIt(ISO7816.SW_WRONG_LENGTH) ;
              // Reads the debit amount from the APDU buffer
    // Starts at offset 5 in the APDU buffer since the 5 first bytes
    // are used by the APDU command part
              short amount = (short)(((apduBuffer[6]) & (short)0x000000FF)
    | ((apduBuffer[5] << 8 ) & (short)0x0000FF00));
    // tests if the debit is valid
    if((balance >= amount) && (amount > 0))
    // does the debit operation
    balance -= amount ;
    // writes the new balance into the APDU buffer
    // (writes after the debit amount in the APDU buffer)
    apduBuffer[7] = (byte)(balance >> 8) ;
    apduBuffer[8] = (byte)balance ;
    // sends the APDU response
    apdu.setOutgoing() ; // Switches to output mode
    apdu.setOutgoingLength((short)2) ; // 2 bytes to return
    // offset and length of bytes to return in the APDU buffer
    apdu.sendBytes((short)7, (short)2) ;
              /*short points = 10;
    AID loyaltyID = JCSystem.lookupAID(loyaltyAID, (short)0, (byte)loyaltyAID.length);
              if(loyaltyID == null)
                   ISOException.throwIt((short)(SW_LOYALTY_APP_NOT_EXIST));
              TestInterface sio = (TestInterface)(JCSystem.getAppletShareableInterfaceObject(loyaltyID, (byte)0x00));
              if(sio == null)
                   ISOException.throwIt((short)(SW_FAILED_TO_OBTAIN_SIO));
              sio.creditPoints(points);*/
    else
    // throw a UserException with illegal amount as reason
    throw new UserException(ILLEGAL_AMOUNT) ;
    /* byte points = (byte)0x0A;
              //short points = 10;
    AID loyaltyID = JCSystem.lookupAID(loyaltyAID, (short)0, (byte)loyaltyAID.length);
              if(loyaltyID == null)
                   ISOException.throwIt((short)(SW_LOYALTY_APP_NOT_EXIST));
              TestInterface sio = (TestInterface)JCSystem.getAppletShareableInterfaceObject(loyaltyID, (byte)0x00);
              if(sio == null)
                   ISOException.throwIt((short)(SW_FAILED_TO_OBTAIN_SIO));
              sio.creditPoints(points);*/
    * Performs the "credit" operation on this counter. The operation is allowed only
    * if master pin is validated
    * @param apdu The APDU to process.
    * @exception ISOException If the APDU is invalid or if the amount to credit
    * is invalid.
    private void credit(APDU apdu) throws ISOException
    // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
                   ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
    // the operation is allowed only if master pin is validated and authentication is done
         if (!validPIN || !authenticationDone)
    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
    // get the APDU buffer
    byte[] apduBuffer = apdu.getBuffer();
              // gets the length of bytes to recieved from the terminal and receives them
    // if does not receive 2 bytes throws an ISO.SW_WRONG_LENGTH exception
              if(apduBuffer[4] != 2 || apdu.setIncomingAndReceive() != 2)
    throw new ISOException(ISO7816.SW_WRONG_LENGTH) ;
              // reads the credit amount from the APDU buffer
    // starts at offset 5 in the APDU buffer since the 5 first bytes
    // are used by the APDU command part
              short amount = (short)(((apduBuffer[6]) & (short)0x000000FF)
    | ((apduBuffer[5] << 8) & (short)0x0000FF00));
    // tests if the credit is valid
    if(((short)(balance + amount) > maximumBalance) || (amount <= (short)0))
    throw new ISOException(ISO7816.SW_DATA_INVALID) ;
    else
    // does the credit operation
    balance += amount ;
    * Performs the "init_update" security operation.
    * @param apdu The APDU to process.
    private void init_update( APDU apdu )
    // receives data
    apdu.setIncomingAndReceive();
    // checks for existing active secure channel
    if(channelOpened)
    // close the openned security channel
    try
    securityObject.closeSecureChannel(secureChannel);
    catch(CardRuntimeException cre2)
    // channel number is invalid. this case is ignored
    // set the channel flag to close
    channelOpened = false;
    try
    // open a new security channel
    secureChannel = securityObject.openSecureChannel(apdu);
    // set the channel flag to open
    channelOpened = true;
    // get expected length
    short expected = apdu.setOutgoing();
    // send authentication result
    // expected length forced to 0x1C
    apdu.setOutgoingLength((byte)0x1C);
    apdu.sendBytes(ISO7816.OFFSET_CDATA, (byte)0x1c);
    catch(CardRuntimeException cre)
    // no available channel or APDU is invalid
    ISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);
    * Performs the "external_authenticate" security operation.
    * @param apdu The APDU to process.
    private void external_authenticate( APDU apdu )
    // receives data
    apdu.setIncomingAndReceive();
    // checks for existing active secure channel
    if(channelOpened)
    try
    // try to authenticate the client
    securityObject.verifyExternalAuthenticate(secureChannel, apdu);
    // authentication succeed
    authenticationDone = true;
    catch(CardRuntimeException cre)
    // authentication fails
    // set authentication flag to fails
    authenticationDone = false;
    // close the openned security channel
    try {
    securityObject.closeSecureChannel(secureChannel);
    } catch(CardRuntimeException cre2) {
    // channel number is invalid. this case is ignored
    // set the channel flag to close
    channelOpened = false;
    // send authentication result
    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
    // send authentication result
    ISOException.throwIt(ISO7816.SW_NO_ERROR);
    else
    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
    * The "reset_security" method close an opened secure channel if exist.
    * @return void.
    public void reset_security()
    // close the secure channel if openned.
    if(secureChannel != (byte)0xFF)
    try
    // close the openned security channel
    securityObject.closeSecureChannel(secureChannel);
    catch(CardRuntimeException cre2)
    // channel number is invalid. this case is ignored
    // reset security parameters
    secureChannel = (byte)0xFF;
    channelOpened = false;
    authenticationDone = false;
    return;
    and the 3rd code is:
    package com.gemplus.examples.loyalty;
    import javacard.framework.Shareable;
    public interface TestInterface extends Shareable
    // public void creditPoints(byte points) ;
              public void creditPoints(byte points) ;
    Thanks in advance......

    Thanks. I know they are not the same thing. A package cannot be deleted if it contains one or more applets.
    I tried to delete by typing in the applet AID first, but it just doesn't work. And of course it doesn't work for package AID.
    Both the package and applet AID are generated in JBuilder, which looks like this, package AID(6D 79 70 61 63 6B 61 67 31),
    applet AID(6D 79 70 61 63 30 30 30 31),
    instance AID(6D 79 70 61 63 30 30 30 31)
    I've tried those three AIDs, it's not working.
    Thanks.

  • I need to reprogram the delete and enter key to the left side of a external keyboard for the ipad mini. don't need the caps/lock or ctrl key and due to an injury my daughter can only use her left hand to type. She is using a text to speech app to verbaliz

    I need to reprogram the delete and enter key to the left side of a external keyboard for the ipad mini. I don't need the caps/lock or ctrl key. Due to a brain injury my daughter can only use her left hand to type. She also uses a text to speech app to verbalize all of her needs since her speech isn't intelligible any longer either. And her vision was significantly affected also, so the keyboard has to be mounted about 6 inches from her face. So to reach across the keyboard with her left hand to the right side delete and enter button is physically difficult and causes typing errors, which cause people to not understand what shes trying to say.
    The best keyboard so far is the Zagg folio mini. I just had to make stickers to enlarge the letters on the key buttons.
    Does anyone know how I can reprogram these two keys? Or where I can buy a wireless mini keyboard for Ipad made for lefthanders with these two functions on the left side. I have searched for days and days. It's sooooo important to me that she be able to contribute her voice again. Imagine if you got in a car accident and couldn't speak clearly any longer, but understood everything still. Thanks for any help and suggestions you all take the time to share with me. I really appreciate the kindness of strangers to help me help my daughter.
    Sami's mom

    Sami\'s mom wrote:
    I need to reprogram the delete and enter key to the left side of a external keyboard for the ipad mini.
    You cannot.

  • Could you please help me understand the logic behind certain things in OSX?

    Ok, so I try to be an open-minded guy, and I bear no particular allegiance to either OS. I own a Sony TZ and a Mac mini, and my wife has a MacBook Pro. I use both Oses.
    There are certain things I have trouble understanding in th Mac OS, so what I'd really like to understand the logic behind certain design decisions in the OS, and why these might be better ways of accomplishing things. I know how to get around all of the things I mention, so I'm not looking for instructions; rather I'm looking for well-thought out explanations for why these features are the way they are.
    *1. Programs don't quit when you close the window.*
    - This totally puzzles me. Why design it so that program windows are independent are from the running program itself? There must be a reason, cold someone explain how this is more efficient? To me, it's simpler to click an X on the window you are working on to completely shut down a program, rather than to either mouse through menus to select quit, or be obligated to using Command Q keyboard shortcut.
    *2. Menu bars are on the desktop.*
    - Related to the first point, why make the main thing framing your desktop be something which is always changing depending on the program? Why have file menus outside the main window of the program. Having the menu bar on the desktop then necessitates an additional area, the dock, which has to be used as a launch bar and to tell you what programs are currently running. That obligates you to having 3 different areas of screen: 1 for program menus, 1 for running programs, and the program window itself. This seems very inefficient to me. Not to mention all the messy-looking floating palettes all over the place, again because everything is separated and not nicely contained in a single program window.
    - Really, having a changing menu bar that frames the desktop isn't even consistent wth the whole desktop metaphor, which is that you place things on a desktop, like programs, files, etc. Are you changing the whole desk everytime you load a new program, yet the wallpaper stays the same? Doesn't seem to be logically consistent to me.
    *3. No delete key.*
    - This one really gets me. Why make such a commonly used key be a function key (Fn + Backspace)? Why make the user press a secondary key for a major function?
    *4. No Cut command.*
    - I read something about how Cut doesn't actually make sense when moving files around, but I obviously didn't fully understand it. Why make the user command drag, when you can just do Ctrl X??.
    *5. Launching Apps from the Finder.*
    - This seems weird to me, that you find and launch applications from the same thing you use to view files. Program icons in the finder are placeholders for the entire program, not files, yet they are found in the file viewer. Again, to me this seems logically mixed. I really dislike scrolling through Finder to look for apps. I know there is Spotlight and the dock (used as a quicklauncher), but these are really just workarounds for a setup which seems inherently illogical. To me at least, a menu of applications make more sense, ie, the start menu.
    Anyway, those are all I can think of now, although there are other things aout OSX that don't make sense to me.
    Thanks in advance! If I can understand Apple's reasoning and it is convincingly better, that will go a long way towards making me more comfortable with this OS.

    1. Programs don't quit when you close the window.
    That's really more a matter of what you're used to. It comes down to a programming decision as to what Apple and Microsoft considered to make sense. MS thinks that if there are no open windows, you're done using the app. Apple thinks you aren't necessarily done yet, as others have mentioned. I certainly wouldn't want Photoshop to quit every time I closed the last open image I was working on. Would be nice though if Safari would quit when I close the last open browser window. It's quick to relaunch if you really weren't done with it, so wouldn't be much of a bother to have it shut down with the last window.
    2. Menu bars are on the desktop.
    Makes way more sense the Microsoft's approach of repeating the same file menu on every open document in a program. How many places do you need to see File, Options and other common menu headings?
    2. Menu bars are on the desktop.
    Related to number two. The forward app is the only one you can directly work in, so why not have the menu bar change to reflect the choices for that application? When you go back to the previous app you were in, the menu bar changes back. So what loss of functionality is there? It comes back to not having menu bars on every single open window. There's no need or purpose for it.
    3. No delete key.
    Backspace does the same thing.
    4. No Cut command.
    Command+X, not Ctrl+X. This is Mac, not Windows. There's also very little need to ever do this from the keyboard. If you're moving files that are on the same drive/partition, then just drag and drop from the target folder window to the source. It's automatically a move. If going from one physical drive or partition to another, it's automatically a copy. Press and hold the Command key during the drag to make it a move.
    Besides, you don't really think Windows cuts the entire folder or file contents into RAM, do you? If your computer has 4 GB of RAM, and you cut 12 GB of data, it of course can't possibly fit in the clipboard. All Windows does when you do a cut is visually remove the files and folders from the screen. If the items are going to a location on the same drive/partition, it does the same thing as if you did a drag and drop move. The file table is simply updated to reflect the new file or folder locations. If it's to a different drive/partition, it then performs a copy then delete action, same as OS X.
    5. Launching Apps from the Finder.
    A program is just as much a file as any other file. It takes up space on the drive. The OS of course knows what to do with it when you double click an app. Same as it knows what to do when you double click a document related to an app. Windows is no different. An .exe file is also just as much a file as a .doc file. The .exe extension tells Windows to try and treat it as a program to load into RAM. It's not just a simple placeholder. The program has to be made up of something.

  • How do I clear all of the java applets that have been downloaded?

    I migrated firefox and other applications to my new mac so that I would not to reenter all of my passwords saved by firefox. However, it appears that the java applets were also transfered and one of these applets does not work with the new intel mac. I was able to get the same applet to work in safari, and I was able to delete the applet from safari as well, but was unable to do so in firefox.
    So, how do I clear all of the previously downloaded applets, or even better, just the one I want to? Clearing all of the recent history didn't work.
    Here is the site:
    http://www.mdbg.net/chindict/chindict.php
    == This happened ==
    A few times a week

    I did that already, and it cleared the applets for Safari, but not for Firefox.

  • Trying to understand the basics of iTunes

    It may sound stupid, but after having read various manuals, guides, forum discussions, I still don't understand the basics of iTunes - is a 64 yo maybe too old for this?
    Yes, I can fill my iPod with music and sync it with my laptop. But to manage everything well, I need answers on these questions:
    - After I add my laptop folder MY MUSIC to the iTunes library, does iTunes make COPIES of all my files in that folder? Or just links? If copies, where are they stored?
    - What does the term synchronisation include? Does it mean: the music in the iTunes library will be identical to the music in the iPod? Or:
    - Will all changes in that folder automatically lead to updates of my iTunes library? Changes such as adding/removing files, changing filenames, modifying files with audio editors. If the contents are not automatically updated/synchronised, is there a manual way to do that?
    - And vice versa: if I delete a song in iTunes, does that effect the source file in MY MUSIC? If not, is there an option to delete the song there as well?
    - Could I theoretically delete the whole contents of MY MUSIC folder after all files have been added to iTunes? Is it recommended to do so? Or should I keep the 'originals'?
    - The same goes for cd's: After I (automatically or manually) added the contents of a cd to iTunes, could I theoretically throw or give it away?
    - There is the option to find doubles. If I want to delete one or more of them, how do I know which file I delete. I mean this: if song X is part of album A but also of a bunch of single files, then I would like to keep the album folder complete and just delete the 'single' occurrence. But how to determine that?
    - Changing filenames in MY MUSIC often has no effect on the filename as displayed in iTunes. Why not?
    - I think that is all for now. Maybe later I still come across more basic questions.
    Could anyone give me the basic answers? And if possible in language for dummies, not in nerd slang, please
    Thanks!
    WimYogya
    Dutchman in Indonesia

    *After I add my laptop folder MY MUSIC to the iTunes library, does iTunes make COPIES of all my files in that folder? Or just links? If copies, where are they stored?*
    That depends. Open iTunes and go to Edit>Preferences>Advanced. If "Copy files to iTunes Music Folder" is checked then iTunes is "copying" the files into the iTunes Music folder which is inside the iTunes folder. The library is then referenced to the location of the copy ( in this case you can if you wish delete the original). If it's unchecked it is adding the songs to to your iTunes library but referencing the location that the file is in without making a copy.
    *Will all changes in that folder automatically lead to updates of my iTunes library? Changes such as adding/removing files, changing filenames, modifying files with audio editors.*
    No, iTunes doesn't support folder watching so all changes have to be made within iTunes.
    *If the contents are not automatically updated/synchronised, is there a manual way to do that?*
    File>Add File to Library: Adding Content to iTunes
    *if I delete a song in iTunes, does that effect the source file in MY MUSIC? If not, is there an option to delete the song there as well?*
    iTunes will delete songs from the library and move them to Trash (Recycle Bin) only if they are in the iTunes Music folder. (iTunes will ask if you want to trash the file if this is the case, it doesn't trash it automatically). If your songs are kept outside of this folder then deleting only removes the reference to the song from the library and you have to go to the folder they are located in to trash the file itself.
    *Could I theoretically delete the whole contents of MY MUSIC folder after all files have been added to iTunes? Is it recommended to do so? Or should I keep the 'originals'?*
    You could only delete the songs from the original folder if you have set the preference above to copy the files to the iTunes Music folder, if not you have to keep them where they are. Regardless of where the files are stored you would be well advised to back them up in case you have problems with your computer. You might also find this article interesting/useful: iLounge - The Complete Guide to Backing Up your iTunes Library
    *The same goes for cd's: After I (automatically or manually) added the contents of a cd to iTunes, could I theoretically throw or give it away?*
    You don't own the copyright of the song, basically you own the license to play it. if you make a copy and then sell/give the CD away you are essentially sharing the files illegally.
    *There is the option to find doubles. If I want to delete one or more of them, how do I know which file I delete. I mean this*
    You would have to check the location of the file manually to be sure which one you wanted to keep.
    *Changing filenames in MY MUSIC often has no effect on the filename as displayed in iTunes*
    Because iTunes doesn't support folder watching, changes need to be made within iTunes. Changing the name of a file outside of iTunes can cause iTunes to lose the location of the file since it is referenced under the name it had when you added it.

  • Skip the DELETE command on logical standby

    Hi All,
    I want to skip the DELETE command on logical standby.
    DB Version - 10.2
    OS - Linux
    Primary DB and logical standby DB .
    In our DB schema some transaction tables. We delete data from those tables by delete commands.
    Delete command, also delete data from logical standby DB. But we want to skip on logical standby DB .
    I use following for that and get error.
    ALTER DATABASE STOP LOGICAL STANDBY APPLY;
    EXECUTE DBMS_LOGSTDBY.SKIP (stmt =>'DELETE TABLE', schema_name =>'TEST',object_name =>'TRANS',proc_name => null);
    ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;
    But I got error
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'SKIP'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    When I change stmt =>'DELETE TABLE' to stmt =>'DML', no error happen
    Please help me to solve this issue . This is urgent.
    Thanks in advance.
    Regards

    Dear aditi2,
    Actually it is so simple to understand the problem. Please read the following documentation and try to understand the SKIP procedure.
    http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/d_lsbydb.htm#997290
    *SKIP Procedure*
    Use the SKIP procedure to define filters that prevent the application of SQL statements on the logical standby database.
    By default, all SQL statements executed on a primary database are applied to a logical standby database.
    If only a subset of activity on a primary database is of interest for application to the standby database,
    you can use the SKIP procedure to define filters that prevent the application of SQL statements on the logical standby database.
    While skipping (ignoring) SQL statements is the primary goal of filters,
    it is also possible to associate a stored procedure with a DDL filter so that runtime determinations can be made whether to skip the statement,
    execute this statement, or execute a replacement statement.
    Syntax
    DBMS_LOGSTDBY.SKIP (
         stmt                      IN VARCHAR2,
         schema_name               IN VARCHAR2,
         object_name               IN VARCHAR2,
         proc_name                 IN VARCHAR2,
         use_like                  IN BOOLEAN,
         esc                       IN CHAR1);Hope That Helps.
    Ogan
    Edited by: Ogan Ozdogan on 30.Tem.2010 13:03

  • Information about the deleted sales order line item in idoc.

    Hi Experts,
    I am new to IDOC.We have the following idoc requirement,
    When a line item is deleted from the sales order(VA02) ,
    the outbound idoc getting triggered for the sales order has the information about the rest all line items other than the deleted line item.We now want the information about the deleted line item in the Idoc .
    Please help me in proceeding further.

    Hi,
    I am facing the same scenario of capturing the  deleted sales order line item in idoc.
    I am using ORDRSP message type , where in E1EDP01- ACTION contains value  "000" .
    And the Deletion line item is not been captured, is there any configuration setting required to
    capture the deleted line item in Idoc.
    Based on the posting in this thread i understand that there is an  indicator which has to be set .
    Please let me know what is that indicator and how to set it?
    Thanks
    Sathish

  • How to set the "delete" button in Mail to actually delete instead if Archive Google Mail messages...

    I know these kinds of questions are asked a lot, but I just wanted to ask my specific question for a nice specific answer.
    I understand Gmail's thoughts on archiving and labels, but it makes gmail a beast to work with on mail clients.  I FINALLY have everything set up perfectly on my Mac's Mail app so that everything syncs and I get no duplicate messages.
    The only issue I have is that when I highlight emails and press the "trash" icon in the toolbar (and hit the delete key I assume) the message(s) is/are archived in the All Mail folder instead of going into the "Trash" folder.  The only way I can truly delete messages is to drag and drop them into the Gmail/Trash folder in the side bar, which can get tedious. 
    Is there anyway to set the "delete" icon and delete key to actually send messages to the trash instead if archiving without causing syncing issues, or do I just need to stick with the drag and drop method?
    Thank you.
    Respectfully,
    JAC151

    Take a look here: http://jeffschuette.com/2012/03/07/setting-up-apple-mail-to-rock-and-roll-with-g mail/
    Jeff explains why it happens and how to deal with it.

  • Delay before the Delete option is active after selecting messages

    Previously I could select numerous messages (Command-A) and immediately press the Delete button in the Mail menu bar to delete the selected emails.
    Since the update, there is now a delay from the time the messages are selected until when the Delete icon is active and can be clicked. It stays grayed out for maybe a second or two, like it's still processing the previous select all command. Although not a big deal, it's worth noting there was no delay before the update.

    You ask:
    So, how can I do that please?
    But you have already answered:
    selecting the photos on Album view, then pressing CMND OPTION DELETE, then CNTRL-CLICKING on iPhoto's Trash icon and choosing "Empty Trash".
    Sorry but I really don't understand what you're asking.
    Regards
    TD

Maybe you are looking for

  • Using search in iCloud email (Doesn't work well)

    Hi everyone, I'm having problems with the search feature in iCloud email.  I rely on searching for dates and other topics for my work.  I get so many emails the search feature is critical to my work.  It's gotten to the point that I forward every ema

  • Interactive forms by email - PRINTING SCENARIO - From ERP output

    Hi, We have been using interactive forms for printing scenarios for a while and it works fine. From a sales order we produce an output configured to use the interactive forms by adobe. Now, we'd like to use the EXTERNAL SEND (5) and send by email. Wh

  • Launch Full Screen in Moodle (Scorm Compliant)

    Hi, Now that I have resolved my original issue with Captivate + Moodle & Scorm, on to the next question I have created a test CP4 module at 800 X 600 When setting up the Scorm module in Moodle, I have had dramas getting the Stage Size set correctly.

  • 10g RAC's listener cannot startup when the node's back from down

    Hello My 10g RAC node1 down and I reboot it , then everything's back except the listener of node1. [oracle@node2 crsd]$ crs_stat -t Name Type Target State Host ora....SM1.asm application ONLINE ONLINE node1 ora....E1.lsnr application    ONLINE    OFF

  • Why does iPhoto always open/appear at launch?

    Why does iPhoto always open/appear at launch? Someone used my computer under another account, and now my preferences seem to be changed. How do I fix it so iPhoto must me opened manually?