Correct behaviour of iMessage?

I have seen many threads about having multiple iOS devices in sync in terms of iMessage, but I'm trying to figure out the correct behaviour.
I have an iPhone 4S and an iPad 2, both set up for iMessage, and both have my caller ID as one of my apple ids.
If somebody sends me an iMessage to my phone number, if things were working 100% correctly, would that message appear on my iPad or not?
If a message is sent to my apple id, then it works. But obviously most people will send messages to my phone number.
Thanks

De-activate iMessage on the iPad.
De-activate iMessage on the iPhone.
On the phone, go to Settings>General>Reset All Settings (you will lose personalization, bluetooth pairings, WiFi passwords, wallpaper, etc. but you will not lose data).
After the re-set, re-enable iMessage on the phone, then re-enable it on the iPad.
I had to go through that process because none of the messages i sent or recieved were appearing on my iPad. Since going through the process outlined, it's worked like a charm.

Similar Messages

  • TS2755 all my message settings and wifi settings are correct however my imessages wont deliver

    all my message settings and wifi settings are correct however my imessages wont deliver

    Hi - I am assuming your other wireless devices can connect so try this - go to Settings-->General-->Reset-->Reset Netwrok Settings - if this doesn't work you are still in your 90 day support window so I would contact Apple directly at - http://www.apple.com/support/contact/

  • Using a new Mini Ipad not allowing me to use Facetime as cannot log into my Apple ID. Apple ID is correct but failing IMessage and FaceTime log in. Am I missing something?

    I cannot get logged into iMessage or FaceTime with my a Apple ID which has been verified and correct. Is there something I have missed at the set up?

    Where are you trying to log in? You should be able to change your ID at http://appleid.apple.com - can you log in there?
    Before you change your ID you should log out of the iTunes Store and on any devices which are logged into iCloud. Then once you've changed it you can log back in with the new ID. (Your iCloud synced data will disappear from the device when you do this but will reappear when you sign back in - give it time).
    If you are unable to sign into http://appleid.apple.com you will need to contact Support. Go to http://iforgot.apple.com and sign in with your iCloud login. A new password will be sent to your associated email address. If this doesn't work you will have to contact Support. Go to https://getsupport.apple.com . Click' See all products and services', then 'More Products and Services, then 'Apple ID', then 'Other Apple ID Topics' then 'Lost or forgotten Apple ID password'. If you have any problems with that try this form: https://www.apple.com/emea/support/itunes/contact.html

  • CTool  not showing correct behaviour

    Hy! I have tried  to get a tool using CTool interface to draw a text frame it gets selected from a toolbar but,t gets deselected after drawing one text box unlike the ordinary textbox tool which allows drawing of multiple text boxes without having to select it again.
    Can anyone help me?

    Hi,
    Use below code that will help u to sort ur problem.
    import java.io.*;
    import java.util.*;
    import java.text.Format;
    import java.text.DateFormat;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    class employee
    private String nm,curr_dt;
    private Date dob,doj;
    private int salary;
    private String dobb,dojj;
    employee()
    nm="\0";
    dob=null;
    doj=null;
    curr_dt=null;
    salary=0;
    void getdata()throws IOException
    String dt;
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    //we can create date with these 3 type of objects
    DateFormat fm=new SimpleDateFormat("dd-mm-yyyy");
    DateFormat df=new SimpleDateFormat("dd-mm-yyyy");
    //object of base class are type compatible with the object of derived class
    SimpleDateFormat sdf=new SimpleDateFormat("dd-mm-yyyy");
    System.out.print("\nEnter the name of Employee : ");
    nm=br.readLine();
    try{
    System.out.print("\nEnter the date of birth of Employee : ");
    dt=br.readLine();
    dob=(Date)fm.parseObject(dt);
    dobb= fm.format(dob);
    System.out.print("\nEnter the date of joining of Employee : ");
    dt=br.readLine();
    doj=df.parse(dt);
    dojj = df.format(doj);
    }catch(ParseException e){
    Date d=new Date();
    curr_dt=sdf.format(d);
    System.out.print("\nEnter the salary of employee : ");
    salary=Integer.parseInt(br.readLine());
    void putdata()
    System.out.println("\n\n\nEmployee Name : "+nm);
    System.out.println("\nDate of birth : "+dobb);
    System.out.println("\nDate of joining : "+dojj);
    System.out.println("\nCurrent date : "+curr_dt);
    /*if((doj-curr_dt)>1)
    salary+=3000;
    System.out.println("\nSalary of Employee : "+salary);
    class emp
    public static void main(String str[])throws IOException
    employee emp[]=new employee[1];
    System.out.println("\nEnter the detail of employees \n\n");
    for(int i=0;i<1;i++)
    emp=new employee();
    emp[i].getdata();
    System.out.println("\n\nDetail of employees are\n\n");
    for(int i=0;i<1;i++)
    emp[i].putdata();
    thanks,
    prabhu selvakumar.

  • Default keyboard spacebar (number - letter) behaviour not correct within Safari

    IIRC, the correct behaviour for the default keyboard is as follows:
    if you are typing numbers, and you type the spacebar key, the keyboard should switch back to letters. This works correctly everywhere, except when typing in the Safari URL bar.
    note: if you type inside a page in safari, like in google search on the google webpage, the behaviour is correct. It's only seems to be incorrect/different in the URL bar.
    any thoughts?

    Here is additional info about the Mac Keyboard Viewer from Microsoft:
    +It's been my pleasure to work with you on your Microsoft Word 2004 issue. Based on the+
    +issue and the fact that the issue is known and that keyboard viewer is an OS program+
    +and not controlled by Word just interacted with at this time there is no resolution for+
    +the keys not remaining highlighted in Word I will archive your case+
    +Here is a summary of the key points of the case for your records:+
    +Richard when you contacted us you were having an issue with the keyboard+
    +Viewer not retaining the color code when in Word. This is a known issue+
    +And at this time there is no resolution for this issue of color loss from keyboard+
    viewer

  • GR/IR behaviour in PSM (FM) with update in both GR/IR

    Hello Gurus,
    I'd like to ask which is the correct behaviour in PSM when Updating in both GR/IR (in OFUP transaction).
    I'm getting the following behaviour from the system:
    Goods receipt:
    FI document:............... =>......PSM Document:
    Expense acct E  100...............Funds ctr AAA /Comm Item AAA   100  (from expense acct E)
    Clearing acct     -100
    Invoice Receipt:
    FI document................ =>.....PSM Document:
    Clearing acct        100................Funds ctr AAA/ Comm Item AAA   -100 (inheriting expense acct E)
    Supplier acct       -100................Funds ctr AAA /Comm Item AAA    100 (from clearing account)
    If you analyze this from PSM perspective its correct, because the impact in Funds ctr AAA/ Comm item AAA is 100, but when comparing it to controlling real items, there is a difference due to the fact that the expense account E would have a balance of 100 in controlling and 0 in PSM.
    Is this correct anyway?
    Thanx a lot!!

    Hello Mariano,
    The mapping should be:
    Expense account (say, the gl code is 3999999) -> cost element 3999999 -> CI 3999999 30/3 (derived through any desired method)
    Clearing account (say, the gl code is 1999999) -> CI 1999999 40/3
    Vendor reconciliation accout (say, the gl code is 2999999) -> CI 2999999 60/3
    When a PO is created the system derives the FM account assignment for the PO line item. In the above case CI 3999999 will be derived through cost element and a funds center will be derived through a CO object (cost center, internal order, etc).
    During IR process, the system bypasses the derivation mechanism. Instead, the account assignment is inherited from the PO line. So, you should get DR 3999999 and CR 3999999 in FM for the LIV postings.
    Hope this clarifies the matter.
    Regards,
    Ming

  • Questions on ICR reconciliation process 002 (behaviour 2)

    Dear all,
    I am implementing ICR reconciliation process 002   and I have some questions regarding process's behaviour and functionality. I have set u201CDefine Rules for Document Assignments" as following:
    1     POPER     Posting period     = Equal     POPER     Posting period
    10     RTCUR     Transaction currency     = Equal     RTCUR     Transaction currency
    20     TSL     Transaction Currency     -1 Opposite Amount (Only for Value Fields)     TSL     Transaction Currency
    3/ If I am reconciliating company A with partner B in FBICR2, when I assign manually items and reconcile all accounts for this Company A/Partner B I expected that status for Company B and Parther A would be updated but transaction do not seems to work as I expected. Is this the correct behaviour or am I doing something wrong?
    Cheers

    I close this message in order to post it more correctly since I think current message is a bit confusing.

  • Multiple devices with iMessage, FaceTime and calendar in the cloud

    Hi
    There are a number of posts on this, but this is what I do and the issues I face:
    My wife and I use a common apple ID for:
    Notes
    Reminders
    Calandars
    Photostream (when it works, but there are other postings on that)
    Apps
    i.e everything else, Music, apps, and addresses are on our Windows PC
    We have made a number of sub-IDs for our four devices (iphone 5s and 5 plus iPad 1 with IOS6?  and iPad 3) can get the correct emails and iMessages they should and FaceTime rings where it should.
    We have done this by selecting where to receive (at) our messages in settings, e.g. the iPhones use our phone numbers as references. The iPads use a gmail address that we have identified under our one Applie ID. Here can be crossover, but I get my messages and my wife gets hers
    With the addressbook in the cloud, we can arange here medical and other appointments very easily and synce the stuff everywhere. Notes and reminders. This leaves books music and other stuff safely on the PC, backed up, and only updated when we sync.
    This works well, and only when a cloud document is changed in error, do we pay for doing it this way. If my wife were more able, I suppose that she could easily edit the settig details to read my messages, but she has no wish to do this,
    This is all fine, buit since IOS 7, whenever a SIM is swapped, I travel a lot, iTunes and iMessages are st to receive everything on all devices. So, my wife gets my messages and I hers. I have to manually fix these, not an onerous task, now I have done it so many times, and have documemnted it; just ver frustrating.
    I am in the UK now, my wife is in hospital and does not have enough ability to fix the stuation over the phone.I will have to live with this and a temporary phone (that I got for messages and calls).
    What I would like to know is:
    1 - Is there a way to stop IOS 7 updating the Mesage / FaceTime read / contact a locaions everytime I change a SIM?
    2 - Short of creating a new Apple ID for iCloud, and not being able to share calendars, notes, reminders and photostream (when it works), is there a way around this?
    When I gave back home, I will fix the devices up again to make sure we get our separate messages and details. My next UK trip will involve taking the second phone with me.
    Any ideas welcome.
    Tony

    Poulton-le-Fylde, UK
    Do I have a choice as to what actually gets transferred into the cloud or does it take what it wants?  What if I don't care to share particular data with another device, does the cloud take it anyway?

  • Extractor 2LIS_02_SCL -- behaviour when ELIKZ is set

    Dear BI-colleagues,
    we are actually facing an issue with the standard extractor 2LIS_02_SCL - schedule line Level of purchase orders.
    Our system setup:
    The data of this extractor needs to be used to measure a supplier service sevel based upon single schedule lines. My predecessor actually changed the standard definition of this extractor in the System (which might be a reason for our issue?!).
    In the BW-System, one standard staging DSO has been created with the folling key:
    - PO document number
    - PO document position
    - PO document schedule line
    - field BWVORG --> process key to distinguish between purchasing, goods receipt and invoice receipt data
    Coming to the issue....
    We are using the following fields to measure the (on time) Service Level:
    SLFDT statistical delivery date           = "to be" date
    BUDAT booing date of GR / IR           = "as is" date
    --> whenever the BUDAT is higher than SLFDT, the delivery was not in time
    In case a purchase order position has more than one schedule line, we get into trouble using this logic. When the final delivery indicator (field ELIKZ) is set on position level, there are update records passed to the BW for all schedule lines of this position showing as BUDAT the date when ELIKZ was set. Example:
    Record      Record date     Sched. line     SLFDT               BUDAT               Comment        
    1               01.04.2014          1                    01.04.2014     01.04.2014          on time    
    2               10.04.2014          2                    10.04.2014     10.04.2014          on time
    3               15.04.2014          3                    15.04.2014     15.04.2014          with this partial delivery the ELIKZ was set
    4               15.04.2014          1                    01.04.2014     15.04.2014          not in time
    5               15.04.2014          2                    10.04.2014     15.04.2014          due to record 3, a new BUDAT arrives for line 2 --> not in time
    Unfortunately it's not as easy as e.g. just deleting incoming records having the same BUDAT as the last schedule line, as there are some intended processes which can lead to a later BUDAT (e.g. cancellations, corrections...)
    Does anyone know if this is the Standard behaviour of this Extractor? How can I solve my issue?
    Thank you in advance,
    Andre

    Dear Gajesh,
    thank you for your remark.
    Yes indeed the schedule line is in the key of the staging DSO. But as already said, the issue is that there are update records coming for ALL schedule lines whenever the ELIKZ is set on Position Level. From my Point of view the correct behaviour would be to deliver only update records for the last schedule line (the latest line). In my example the records 4 & 5 should never arrive in the BW system.
    On BW side there are no modifications done for this Extractor.. the above mentioned examples are taken out of the PSA table, not from the DSO.
    My requirement is either to stop transferring records 4 & 5 and/or to filter them somehow out in the BW-System, which is - from my point of view - almost impossible. I've already done a deep analysis of the incoming records in the PSA table and I couldn't find any way to separate these records from other, correct ones.
    You said my example is not the standard behaviour... What would it be in this case (and how to restore standard)?
    Thanks and best regards,
    Andre

  • 0 margins and 0 padding still not displaying correctly in Internet Explorer

    Hi I have designed a page for my site that works perfectly in safari and firefox but of course in internet explorer it doesn't.   The content under the slideshow is meant to line up with the edge of the slideshow.  This is the linkhttp://www.kimberleywebdesign.com.au/Links.html.
    The divs and the tags within them, have 0 margins and 0 padding with the exception of top and bottom padding, so even if internet explorer doubled my margins - double nothing is nothinng ??  I am trying to understand why the problem occurred? 

    My understanding is that IE misinterprets text-align:center in the #wrapper div.
    Change:
    #wrapper {
    width:48.75em;/*780px*/
    margin: 0 auto;
    text-align:left;}
    to
    #wrapper {
    width:48.75em;/*780px*/
    margin: 0 auto;
    text-align:center;}
    Then add text-align: left to each div where the text needs to be left aligned
    e.g.
    #portfolio {
    margin:0 auto;
    padding:2em 0 0 0;
    width:680px;
    text-align:left}
    and so on. Worked OK for me in IE8.
    See: http://www.andybudd.com/archives/2004/02/css_crib_sheet_3_centering_a_div/
    Add this tip, taken from the link above, for good measure:
    "This gets IE up to scratch. However this is the step I always forget. In Mozilla, if you reduce the size of the browser window, half of your centred div hangs off the left of the page. This is an odd one, but I've been reliably informed that it's the correct behaviour. To prevent this, just set a min-width on the body tag."

  • BUG: Apex 4.0.1 form on table with report. Not passing ID correctly

    I'm trying to create a form on a table with report using the wizard. I opted for a classic report page.
    The edit link on the report page does not work. The link looks like this:
    http://ngdwpc3:7777/pls/apex/f?p=101:15:1800428764039812::::P15_ID:#ID#
    This is clearly wrong because one would expect a value to be passed and not a column name.
    Looking at the generated report page I get 60 columns. This seems to be a result of the setting:
    no-checked :Use Query-Specific Column Names and Validate Query
    checked :Use Generic Column Names (parse query at runtime only)
    The ID column in the table is mapped to COL01.
    Changing the value being passed in the link columns to #COL01# results in the correct behaviour.
    My guess is that the option "Use Query-Specific Column Names and Validate Query" is the correct setting for the generated report.
    Rene

    Yes, I guess this is a Bug.
    1. When you speciify a WHERE clause in the Wozard it adds extra quotes when appending the WHERE into the Report SELECT.
    I think thats the root cause, all others just follow as a consequence.
    a. Because the query cannot be parse ( two single quotes) the Use Generic Column Names (parse query at runtime only) is automtacillay set
    b. This leads to COL01 to COL60
    c. Which is turn leads to the link not working.
    I could easily recreate the scenario.
    To fix it I did the following
    1. Removed the extra quotes from the query
    2. Selected Use Query-Specific Column Names and Validate Query and Saved
    It started working correct.
    I suggest you edit your Thred name add BUG at the begining so that it gets spotted by Oracle folks on the forum.
    Regards

  • IMessage not in sync

    I have enabled iMessage on both an iPhone and an iPad.
    My iPad stays close to home, and it always connected to the WiFi network.
    My iPhone has spotty reception sometimes, and as such, I don't receive some of the iMessages my friends send me when I'm in an out-of-service area.
    However, with SMS, my messages arrive when I come back to an area with cellular reception. With iMessage, however, my iPad already received the message and apple doesn't bother to send another copy to my iPhone. So oftentimes, I'll miss a significant number of iMessages when I'm on the go because my iPhone is only getting some of the messages. Is there any way to get Apple to forward all the iMessages to my iPhone regardless of whether my iPad has received it or not?

    Hi,
    That is correct.
    Those iMessages sent from the Apple ID using Messages on an iOS device or a Mac should sync across all those devices.
    For instance I send a set of Pics from my Mac to my Apple ID so it goes to my iPhone will also show those Sync'ed back as "received" by the same Apple ID
    Uploaded with Skitch!
    It did seem in the Messages beta that you had to clear all existing Messages off the iOS device before it would sync to the Apple ID.
    (As if the Messages app on the iPhone and the Messages app on the Mac were "Starting" from the "same place").
    There have been suggestions that getting the iPhone to make a break with the server such as switching the iPhone Off then On again will allow it to Sync all exiting Messages when it reconnects.
    The iPhone does need to be set to the Apple ID for the iMessages it sends to sync tgo the Mac or any other iOS device.
    7:09 PM      Saturday; August 11, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Why is iMessage not in sync with iPhone 4?

    I was using the iMessage beta on OSX 10.7 for my iMAC (21.5-inch: 2.5GHz) with no issues and then upgraded to Mountain Lion. My iMessages on my MAC is no longer in sync with the Messages in my iPhone 4 (iOS 5.1.1), (all messages are sent from my iPhone). Messages is always up to date on my iPhone but the only messages that show on my iMAC are the ones before the Mountain Lion upgrade. Any ideas?

    Hi,
    That is correct.
    Those iMessages sent from the Apple ID using Messages on an iOS device or a Mac should sync across all those devices.
    For instance I send a set of Pics from my Mac to my Apple ID so it goes to my iPhone will also show those Sync'ed back as "received" by the same Apple ID
    Uploaded with Skitch!
    It did seem in the Messages beta that you had to clear all existing Messages off the iOS device before it would sync to the Apple ID.
    (As if the Messages app on the iPhone and the Messages app on the Mac were "Starting" from the "same place").
    There have been suggestions that getting the iPhone to make a break with the server such as switching the iPhone Off then On again will allow it to Sync all exiting Messages when it reconnects.
    The iPhone does need to be set to the Apple ID for the iMessages it sends to sync tgo the Mac or any other iOS device.
    7:09 PM      Saturday; August 11, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Not user friendly behaviour for CNiNumEdit control when it has got a focus

    The CNiNumEdit hasn't user friendly behaviour when it has got a focus on TAB event for example.
    If you set a value in your prgram like this code:
    m_ninumedit.SetValue ( 1234 );
    and the focus is on other control and then you press TAB for changing the focus and the control m_ninumedit got it but it put the edit cursor in front of the first character '1'.
    The correct behaviour would be that the control selects all characters to be ready to edit a new value.
    The later versions that 7.1.0.313 have a bad behaviour (cwui.ocx)

    Hello Benjamin,
    You will find  the sources code to test the behavior of CNiNumEdit by using the TAB key between two controls CNiNumEdit.
    Best regards
    Armageddon
    Attachments:
    TestCNiNumEdit.zip ‏510 KB

  • Do someone know the behaviour of the wrap() method?

    Hi all,
    I'm working with an applet that need R-MAC but no card implements it, so i'm implementing my own secure channel.
    But I want to do it well, so..
    do someone know how the wrap() method is supposed to work?
    I have 2 hypothesis:
    1 - the unwrap() method processing remembers the r-mac state, and then the wrap() method has only to be given the data length, actual data and sw.
    2 - the unwrap() method remembers nothing, so the Response APDU has to be appended to the Command APDU and the whole buffer must be passed to wrap(), which means that the length of the command/response pair must not exceed 256 bytes.
    What do you think is the correct behaviour?

              case INS_INITUPDATE:
                   this.flagBuf[OFFSET_CMAC_FLAG] = CMAC_RECALCULATION_NOT_NEEDED;
                   this.flagBuf[OFFSET_SECURE_CHANNEL_FLAG] = SECURE_CHANNEL_CLOSED;
                   // clear CLEAR_ON_DESELECT data if no SELECT before
                   if(this.flagBuf[OFFSET_SELECT_FLAG] != SELECT_APDU_BEFORE){
                        Util.arrayFillNonAtomic(this.lastCMAC, (short)0, (short)this.lastCMAC.length, (byte)0);
                        Util.arrayFillNonAtomic(this.lastRMAC, (short)0, (short)this.lastCMAC.length, (byte)0);
                        Util.arrayFillNonAtomic(this.icvKeyData, (short)0, (short)this.icvKeyData.length, (byte)0);
                   this.flagBuf[OFFSET_SELECT_FLAG] = OTHER_APDU_BEFORE; 
                   // extract host challenge
                   if(dataLength != LENGTH_OF_HOST_CHALLENGE){
                        ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
                   // create session keys
                   // APDU buffer construction
                   // |0     ...    13|14    ...    29|30   ...   45|
                   // | incoming APDU |derivation data|tmp key value|
                   // ENC-Key
                   Util.arrayCopyNonAtomic(DERIVATION_DATA_ENC_KEY, (short)0, buf, (short)14, (short)2);
                   Util.setShort(buf, (short)16, this.sequenceCounter);
                   this.tmpKey.setKey(this.s_ENC_key, (short)0);
                   this.tmpCipher.init(this.tmpKey, Cipher.MODE_ENCRYPT);
                   this.tmpCipher.doFinal(buf, (short)14, (short)16, buf, (short)30);
                   Util.arrayCopyNonAtomic(buf, (short)30, buf, (short)46, (short)8);
                   this.encKey.setKey(buf, (short)30);
                   // CMAC-Key
                   Util.arrayCopyNonAtomic(DERIVATION_DATA_CMAC_KEY, (short)0, buf, (short)14, (short)2);
                   Util.setShort(buf, (short)16, this.sequenceCounter);
                   this.tmpKey.setKey(this.s_MAC_key, (short)0);
                   this.tmpCipher.init(this.tmpKey, Cipher.MODE_ENCRYPT);
                   this.tmpCipher.doFinal(buf, (short)14, (short)16, buf, (short)30);
                   this.cmacKey.setKey(buf, (short)30);
                   // RMAC-Key
                   Util.arrayCopyNonAtomic(buf, (short)30, this.icvKeyData, (short)0, (short)8);
                   Util.arrayCopyNonAtomic(DERIVATION_DATA_RMAC_KEY, (short)0, buf, (short)14, (short)2);
                   Util.setShort(buf, (short)16, this.sequenceCounter);
                   this.tmpKey.setKey(this.s_MAC_key, (short)0);
                   this.tmpCipher.init(this.tmpKey, Cipher.MODE_ENCRYPT);
                   this.tmpCipher.doFinal(buf, (short)14, (short)16, buf, (short)30);
                   this.rmacKey.setKey(buf, (short)30);
                   // create card cryptogram
                   // APDU buffer construction
                // |30   ...    37|38     ...    39|40   ...    45|46  ...  53| <-- buf
                   // |Host Challenge|Sequence Counter|Card Challenge|DES padding|
                   Util.arrayCopyNonAtomic(buf, (short)5, buf, (short)30, (short)8);
                   Util.setShort(buf, (short)38, this.sequenceCounter);
                   Util.arrayCopyNonAtomic(this.cardChallenge, (short)0, buf, (short)40, (short)6);
                   Util.arrayCopyNonAtomic(DES_PADDING, (short)0, buf, (short)46, (short)8);
                   // we can save time if we reuse the initialized cipher
                   // for the encryption of the card challenge used for verification in EXT-AUTH
                // |0   ...        1|2     ...    8|9   ...     16| <-- swapBuf
                   // |Sequence Counter|Card Challenge|Host Challenge|
                   Util.arrayCopyNonAtomic(buf, (short)38, swapBuf, (short)0, (short)8); // counter + card challenge
                   Util.arrayCopyNonAtomic(buf, (short)30, swapBuf, (short)8, (short)8); // host challenge
                   Util.arrayCopyNonAtomic(DES_PADDING, (short)0, swapBuf, (short)16, (short)8); // DES Padding
                   this.tmpCipher.init(this.encKey, Cipher.MODE_ENCRYPT);
                   this.tmpCipher.doFinal(buf, (short)30, (short)24, buf, (short)4); // card cryptogram
                   this.tmpCipher.doFinal(swapBuf, (short)0, (short)24, swapBuf, (short)0); // host cryptogram
                   // build response APDU
                   // APDU buffer construction
                   // |0         ...        9|         10       | 11|12    ...     13|14    ...   19|20    ...    27|
                   // |Key Diversification Data|Key Version Number|SCP|Sequence Counter|Card Challenge|Card Cryptogram|
                   Util.arrayCopyNonAtomic(this.keyDiversicationData, (short)0, buf, (short)0, (short)10);
                   buf[10] = this.keyVersionNumber;
                   buf[11] = SECURE_CHANNEL_PROTOCOL;
                   Util.setShort(buf, (short)12, this.sequenceCounter);
                   Util.arrayCopyNonAtomic(this.cardChallenge, (short)0, buf, (short)14, (short)6);
                   apdu.setOutgoingAndSend((short)0, (short)28);
                   this.flagBuf[OFFSET_INIT_UPD_FLAG] = INIT_UPD_BEFORE; 
                   break;
              case INS_EXTAUTH:
                   this.flagBuf[OFFSET_SECURE_CHANNEL_FLAG] = SECURE_CHANNEL_CLOSED;
                   if(this.flagBuf[OFFSET_INIT_UPD_FLAG] != INIT_UPD_BEFORE){
                        this.flagBuf[OFFSET_CMAC_FLAG] = CMAC_RECALCULATION_NOT_NEEDED;
                        ISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);
                   this.flagBuf[OFFSET_INIT_UPD_FLAG] = OTHER_APDU_BEFORE;
                   // CLA BYTE = GP + SM
                   if(buf[ISO7816.OFFSET_CLA] != (byte)0x84){
                        this.flagBuf[OFFSET_CMAC_FLAG] = CMAC_RECALCULATION_NOT_NEEDED;
                        ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
                   // Minimum C_MAC (or CRMAC?)
                   if((buf[ISO7816.OFFSET_P1] & (byte)1) != C_MAC_ONLY) {
                        this.flagBuf[OFFSET_CMAC_FLAG] = CMAC_RECALCULATION_NOT_NEEDED;
                        ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
                   } else if(buf[ISO7816.OFFSET_P1] == C_MAC_ONLY)
                        this.flagBuf[OFFSET_SEC_LEVEL] = C_MAC_ONLY;
                   else if(buf[ISO7816.OFFSET_P1] == C_AND_R_MAC)
                        this.flagBuf[OFFSET_SEC_LEVEL] = C_AND_R_MAC;
                   else {
                        this.flagBuf[OFFSET_CMAC_FLAG] = CMAC_RECALCULATION_NOT_NEEDED;
                        ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
                   if(dataLength != LENGTH_OF_HOSTCRYPTOGRAM_AND_MAC){
                        this.flagBuf[OFFSET_CMAC_FLAG] = CMAC_RECALCULATION_NOT_NEEDED;
                        ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
                   if(!this.encKey.isInitialized()){
                        this.flagBuf[OFFSET_CMAC_FLAG] = CMAC_RECALCULATION_NOT_NEEDED;
                        ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
                   // 1st verify host cryptogram (encrypted card challenge)
                   // swapBuf holds our encrypted challenge, prepared in INIT-UPD
                   if(Util.arrayCompare(buf, ISO7816.OFFSET_CDATA, swapBuf, (short)16, (short)8) != 0){
                        this.flagBuf[OFFSET_SECURE_CHANNEL_FLAG] = SECURE_CHANNEL_CLOSED;
                        ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
                   // 2nd verify CMAC on EXT-AUTH
                   this.verifyCMAC(buf, dataLength);
                   // increment sequence counter to avoid 'Replay Attack'!
                   if(sequenceCounter != (short)0xFFFF)
                        this.sequenceCounter++;
                   // this MAC will be the initial ICV for R-MAC
                   Util.arrayCopyNonAtomic(lastCMAC, (short)0, lastRMAC, (short)0, LENGTH_OF_MAC);
                   this.flagBuf[OFFSET_SECURE_CHANNEL_FLAG] = SECURE_CHANNEL_OPENED;
                   break;
    <next post>

Maybe you are looking for