Class signature implemented or not? 6F00 error

Hello

I am trying to write a code to check the MAC of the java card code, I wrote a test code to familiarize themselves with the method Verify of the Signature class, but the result of executing this code in Gemalto cards and ST are different. If the Signature class has not put in place in one of these cards, he must return 6F00 or not?

This is my code:
private void InsGetKeyInfo(APDU apdu)
     {
         byte[] buffer = apdu.getBuffer();
         byte src[]={(byte)0x32,(byte)0x64,(byte)0x21,(byte)0xB2,(byte)0x80,(byte)0x00,(byte)0x00,(byte)0x00};
         byte Result[]= {(byte)0x36,(byte)0x21,(byte)0xFE,(byte)0x88,(byte)0x55,(byte)0x4D,(byte)0x81,(byte)0xBE};
         Signature instance_MAC = null;
         instance_MAC = Signature.getInstance(Signature.ALG_DES_MAC8_ISO9797_1_M2_ALG3, false);
         DESKey deskey1;
         deskey1 = (DESKey)KeyBuilder.buildKey(KeyBuilder.TYPE_DES,
                    KeyBuilder.LENGTH_DES3_2KEY, false);
         
         byte value[]={(byte)0x82,(byte)0xDE,(byte)0x41,(byte)0xBF,(byte)0x90,(byte)0xD2,(byte)0xD8,(byte)0x10,(byte)0x84,(byte)0x71,(byte)0x3C,(byte)0x07,(byte)0x54,(byte)0x35,(byte)0x11,(byte)0x65};
         deskey1.setKey(value,(short)0);
         
         
         byte IV[]={(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00};
         instance_MAC.init(deskey1,Signature.MODE_VERIFY,IV,(short)0,(short)8);
         boolean bl = instance_MAC.verify(src, (short)0, (short)4,Result, (short)0,(short)8);
         if(bl)
              ISOException.throwIt((short)0x6E00);     
         else
              ISOException.throwIt((short)0x6B00);         
         
     }
As you can see I used 326421B 280000000 as input data and 82DE41BF90D2D81084713C0754351165 in the form of key data. I calculated the MAC result by myself which is 3621FE88554D81BE. So I put this string of MAC in the results table to be used in the Verify method.

I loaded this code in my Gemalto card and the card 0x6E00, so I can say that the result of the Verify method is true and all things are OK. But the problem arises when I tested this code on a map of ST. It returns 6F00.
If the map of ST JCRE has not applied the Signature class my method should return 6F00 or another exception that I should wait? How do I know that my ST card has the Signature class or not?

-Thanks a lot

The only one you have to worry is CryptoException. Also, ISOException is not a catch-all exception. You should catch throwable or exception to this (bad practice anyway).

Be aware that you have a large memory leak in your code. You allocate EEPROM to your arrays of bytes whenever the method is called. I understand this is a test (with the hardcoded value) method, but it is advisable to enter.

See you soon,.
Shane

Published by: safarmer on November 2, 2010 06:32

Tags: Java

Similar Questions

  • Class not found error during deployment

    Hello

    I'm running on jboss 4.0.3 SP1-, IOM 9.0.3 latest patch. I'm new to this implementation and rebuilt entire dev environment. I check the provision of resources and ran in a class not found error.

    The error that says:
    2011-10-19 10:23:17, 111 DEBUG [XELLERATE. ADAPTERS] class/method: tcADPClassLoader/FindClass entered from.
    2011-10-19 10:23:17, 111 DEBUG [XELLERATE. ADAPTERS] class/method: tcADPClassLoader:findClass - data: loading class - value: com.jscape.inet.ssh.SshException
    2011-10-19 10:23:17, ERROR 112 [XELLERATE. SERVER] error encountered in the com.thortech.xl.dataobj.tcScheduleItem data object save
    2011-10-19 10:23:17, ERROR 112 [XELLERATE. Class/method SERVER]: tcDataObj/save some problems: com/jscape/inet/ssh/SshException
    Java.lang. * NoClassDefFoundError *: com/jscape/inet/ssh/SshException
    at java.lang.Class.forName0 (Native Method)
    at java.lang.Class.forName(Class.java:164)
    at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpFAPROVISIONING.implementation(*adpFAPROVISIONING.java:92*)
    at com.thortech.xl.client.events.tcBaseEvent.run (unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.runEvent (unknown Source)
    at com.thortech.xl.dataobj.tcScheduleItem.runMilestoneEvent (unknown Source)

    XXXXXXXXXXXXX
    When I watched the process task named "Supply of FA", line 92, I see this reference:

    90:
    91: //Initialize persistent object 'INIT '.
    92: clsINIT = Class.forName("*com.cpsg_inc.oim.unix.SSHCommandExecutor*");
    93: maoConstructorArgs = new Object [] {};
    94: masConParamTypes is new class [] {};.
    95: moCons = clsINIT.getConstructor (masConParamTypes);
    96: INITconsObj = moCons.newInstance (maoConstructorArgs);

    XXXXXXXXXXX
    When I open the task of the adapter named iNIT connection (this is the first task of the task of Provisioning of FA adapter process), Source of the API: JavaTaskJar:cpsgUnix.jar
    The application API: com.cpsg_inc.oim.unix.SSHCommandExecutor
    Manufacturers: 0 com.cpsg_inc.oim.unix.SSHCommandExecutor (public)
    Methods: 9 public Sub com.thortech.xl.integration.tenetssh.helper.SSHPrvosioning.SSHInit (...)

    xxxxxxxxxxxx
    Then I made sure that the named cpsgUnix.jar jar file is present in the OIM_HOME/JavaTasks directory.

    But I still have the error.

    What Miss me?

    Thank you

    Khanh

    Have you pasted sshfactory.jar?

  • Class not found error

    I am using Jdeveloper and using the following code below. I get class not found error for all classes of saxon, how I have implemented so that classes are located? Thanks in advance

    <! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional / / IN".
    "http://www.w3.org/TR/html4/loose.dtd" >
    < % @ page contentType="text/html;charset=windows-1252"% >
    "< % @ page import =".
    net.sf.saxon.value.StringValue,
    net.sf.saxon.trans.DynamicError,
    net.sf.saxon.functions.SystemProperty,
    net.sf.saxon.trans.DynamicError,
    net.sf.saxon.FeatureKeys,
    net.sf.saxon.Configuration,
    net.sf.saxon.trace.XSLTTraceListener,
    net.sf.saxon.TransformerFactoryImpl,

    javax. XML.parsers. *,.
    org. W3C. DOM.*,
    javax. Xml.Transform. *,.
    javax. Xml.Transform.Stream. *,.
    Java.IO.
    % >






    < html >
    < head >
    < meta http-equiv = "Content-Type" content = text/html"; charset = windows-1252 "/ >"
    xslt_test < title > < /title >
    < / head >
    < body >
    < %
    System.setProperty ("javax.xml.transform.TransformerFactory",
    "net.sf.saxon.TransformerFactoryImpl");


    StreamSource xml = new StreamSource (new file ("C:\\Documents and Settings\\BeastMaster\\Desktop\\stylusstudioSupportlistXSL\\report4.xml"));
    StreamSource xsl = new StreamSource (new file ("C:\\Documents and Settings\\BeastMaster\\Desktop\\stylusstudioSupportlistXSL\\report2.xsl"));


    StreamResult result = new StreamResult (out);

    TransformerFactory tFactory = TransformerFactory.newInstance ();
    Transformer transformer = tFactory.newTransformer (xsl);


    transform. Transform (xml, result);
    % >




    < / body >
    < / html >

    Create a library containing all the jars necessary for the saxon to run and add it to your project.

    Timo

  • error "itunes has an invalid signature, it will not be installed."

    Hi everyone, I get 'itunes has an invalid signature, it will not be installed' error when Apple Software Updater is downloaded and installed iTunes 12.4.1. Although my iTunes itself indicates the version of curren (12.1.3) is the latest version, software update tries to update and gives this error. What to do to correct this error and install the latest update?

    Thank you

    Are you sure that you run Windows 10 as stated in your slogan?  What is Win XP?

    iTunes version 12.1.3.6 is the most recent version running on Windows XP.  Above you need to Windows 7 or a later version.

  • Class not registered error

    How to solve the problem of unregistered class. I am not able to move to a single file or folder of the download folder. always shows unregistered class message. Please help me.

    Hi Nilesh,

    We need after the details so that we can better help you.

    (1) what is the version of the Windows operating system installed on your computer?

    (2) you are able to move files to or from any other place?

    (3) don't you make changes to your computer before this problem?

    Try to start your computer to the clean boot state where all Non Microsoft applications will be disabled to check if this problem is due to any third party application. To help resolve the error and other messages, you can start Windows by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    How to perform a clean boot in Windows

    http://support.Microsoft.com/kb/929135

    Note: Please refer to the section: How to reset the computer to start normally after a boot minimum troubleshooting section of Kb to start the computer to a normal startup after you fix the problem.

    Let us know the status of the issue.

  • Unable to upgrade Windows Vista to 7, error: implementation could not determine whether the BitLocker Drive encryption is in use.

    Original title: Upgrade Vista - 7 and issue of Bitlocker.

    I'm upgrading stops priocess Vista-32 to Windows 7 family 32-bit and upgrade when checking report of compatibility as a result of the error message following: "implementation could not determine if BitLocker Drive Encryption is in use.

    I have established that my Vista is not only encryption, so I can't turn it OFF... it's weird I had myself far enough in before upgrading... always new problems affecting it right back

    Hello

    I suggest you try the steps suggested by Andre Da Costa replied on March 27, 2010. From the following link:
    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-windows_install/Setup-was-unable-to-determine-if-BitLocker-Drive/7be7ac98-5e73-49e5-9636-179cf7b11b23

    See also: What is the difference between disabling BitLocker Drive encryption and decrypt the volume?

    http://Windows.Microsoft.com/en-us/Windows-Vista/what-is-the-difference-between-disabling-BitLocker-Drive-encryption-and-decrypting-the-volume

  • Suddenly the apps work not (start.. net.rim.device.api.ui.manager .class not found error)

    All of a sudden my apps no longer work

    always "start XXXX error: class 'net.rim.device.api.ui.manager' not found.

    everything compiles fine

    remove all my cod, jar,... directory of Simulator

    clean all projects

    Nothing helps

    from a demo app

    My applications have dependencies to some libraries

    really, you're wondering where to find

    any ideas?

    reason: size of the resource of a library project has been nearly 8 MB

    one of my libraries (where the wallpaper of my browser are stored as png resources) becomes a size of about 7.5 MB

    I know that 8 MB less certain overhead is the maximum allowed size

    (this is the reason why I use some library projects)

    I have learned the hard way that a message like

    NullPointer INTERNAL means "application or a resource too large.

    in this case last month as he tried to PACKAGE an application where the limits of size (app 8MB max size + resource set size 8 MB max) are reached

    but this time there was no error when packing - my library projects and soft with dependencies to these libraries compile well and packing has been without any reported errors

    This time, it occurs during EXECUTION of the application and an error like ' net.rim... class ui. Manager not found "is not very intuitive to think that the size of the resource of one of your library projects is too large

    I don't want to revisit the discussion why these limits exist on modern smartphones (do not have these limits with Android or iPhone), but...

    PLEASE PLEASE RIM

    -Why not offer a message meaningful all-in-package as ' Attention: size of the XXX project resources (or the size of the app) is near the maximum of 8 MB - please restructure your projects instead of "class not found during the race.

  • not found error of class definition

    Hello

    I added to my project as external jar jar (this is the jar of the project where I keep written by me, library), I imported to it and wanted to use a simple class just to see if it works. This class is:

    public class A {}

    public A() {}
    System.out.println ("this is a test");
    }
    }

    I created an object at the beginning of my project but then when I run I got: no class not found error of definition...

    Why is this and what can I do with it?

    concerning

    I solved TI-project must be defined as libraray (under properties). It's working now,

    concerning

  • How to fix windows photo viewer showing the class not regitered error in the local system.

    Dear all,

    Please provide me the solution.

    How to fix windows photo viewer showing the class not regitered error in the local system.

    Thank you best regards &,.

    Amol.

    Hello Amol,

    Were there any changes made on the computer before the show?

    The problem may occur if there is a problem with Java on the computer. I suggest you to check the link and try to update Java:

    http://www.Java.com/en/download/help/download_options.XML

    http://www.Java.com/en/download/index.jsp

    Let us know the results.

  • displaying a class not registered error when you call of duty 2 on winds 7?

    whenever I tried to run the game it displays class not registered error

    You said launch, so this may not apply, but apparently, it happens to some people when
    install the game and the fix is not not to use the Autorun feature during installation.
    Go to start-computer and Open the disc. Then run setup.exe from there.

    I don't remember having this problem with COD2. It can only happen if you install to the default location
    Program Files (x 86).
    The game runs without problems on Win7 with no compatibility required setting.

  • 404 not found error was encountered while trying to use an ErrorDocument directive to manage demand

    When I try to go to my site, I get a blank screen and this message:

    Method not implemented

    GET to / not supported.

    Additionally, a 404 not found error was encountered while trying to use an ErrorDocument directive to manage demand.

    Can someone help me fix this bug, please? Thank you!

    This problem may be caused by corrupted cookies or cookies that are blocked (check the permissions on the subject: permissions page).

    Clear the cache and cookies only from Web sites that are causing problems.

    "Clear the Cache":

    • Firefox > Preferences > advanced > network > content caching Web: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Firefox > Preferences > privacy > "Use the custom settings for history" > Cookies: "show the Cookies".

    Please upgrade to the current version of Firefox 30.

    • Firefox > topic

    The version of Firefox you are currently running is no longer supported with security updates.

    • It is important to update Firefox and Add-ons to the latest version to get all security patches.

    You can find the full version of the current version of Firefox 30.0 in all languages and for all systems operating here:

  • When I access my facebook account, it freezes. Then, I get the "not responding" error messages How can I fix this?

    When I access my facebook account, it freezes.  Then, I get the "not responding" error messages  How can I fix this?

    What version of the operating system is running on your computer? Windows Version 5.1

    What browser do you use? Windows Live - Windows Internet Explorer 7

    ·          When the issue started?

    ·          Only happens when you connect to Facebook?

    As best I can answer: error signature when facebook freezes

    szAppName: iexplore.exe szAppVer:8.0.6001.18372 szMacName:hugapp szModVer: 0.0.0. offset: 00000
    He started several days ago and Yes Facebook is the only program that freezes.

    I think 5.1 means that you're running XP, but what Home or Pro version?
    You specify using IE7, but I think that the error message refers to IE 8. You have it improved recently?

    How many times you run a program that cleans ALL accumulated cookies? Not only the option in Windows XP which doesn't seem to work for them all. Try Ccleaner.com, it's free and works well!
    Just need to have all your browser windows closed when you run part of the cleaner. Restart and try to sign Fb.
    If surfing a lot, is recommended to clean/remove cookies on a DAILY basis.

  • Office 2007 does not. gives error 643 with 80070BC9

    New HP (seven) desktop with quad processor, 6 MB of ram, Windows 7 64-bit, McAfee, Spyware Doctor.  A trial of Norton and Office 2007 that I deleted (used on site Norton removal tool).  No problems with updates until after 11/10/09.  Then updates started to not install, but I did not notice until several days ago, when my Outlook window could not open.  Happened to check the update log and saw failures after 11/10.

    I tried manual downloads instead of auto.  Off McAfee when downloading.  The Windows Firewall is disabled.  Nothing has worked.  In desperation, I removed all installations and updates from 11/10 to the front.  No luck.  Removed Office Enterprise 2007 in order to recharge.  Failed to install with the following comments:
    Description:
    Microsoft Office Enterprise 2007 Setup has failed. We are sorry for the inconvenience.

    Signature of the problem:
    Problem event name: Office12Setup
    Signature of the problem 01: {91120000-0030-0000-0000-0000000FF1CE}
    Signature of the problem 02: 12.0.4518.1014
    Signature of the problem 03: PublishProduct
    Signature of the 04:1603 problem
    Signature of the problem 05: 0 x 1935
    Signature of the 06 problem: Error 1935.An error occurred during the installation of Assembly component {97F81AF1-0E47-DC99-A01F-C8B3B9A1E18E
    Signature of the problem 07: X
    OS version: 6.1.7600.2.0.0.768.3
    Locale ID: 1033

    Problem is only with related things Microsoft.  Did a test to download and install Firefox without problem... nothing MS to register the update agent, nada.

    Help, please.  62 retired working on MBA and who need to WORD and EXCEL evil... pronto!

    MS Office Support contact: http://support.microsoft.com/select/Default.aspx?target=assistance

    I would be very surprised if your purchase of Office Enterprise 2007 does not include at least one year of paid support.

    Good luck! ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • When you try to insert a digital signature, it does not accept the password, I just reset.  How can I get include the signature?

    When you try to insert a digital signature, it does not accept the password I just reset for Adobe and will not let me. How can I determine what the password, it's who will give me access to insert the signature?

    Hello

    What is the error you get after inserting the password. Although there is no way to recover the password.

    You can simply create a new digital ID with a new password.

    Concerning

    Sukrit diallo

  • Cannot start Lightroom 6 (standalone) after installation - stuck at the start with scope screen not responding error

    Hi all

    As stated above, I am unable to start Lightroom 6 (standalone) after installation. I am able to launch, but I'm stuck on the boot screen (lightroom logo 6) with bezel does not no error. Would be grateful for any help, thank you very much!

    Just a suite, I use Windows 7 (x 64). I talk with the cat from adobe and I was told to create a new Administrator windows account and reinstall LR by using this new account.

    It worked for me, I am able to successfully access LR 6 using the newly created administrator account. I tried to follow up with another request - I have what patches can implement to my current user account so that I can access LR 6 using that account (and not the new windows user account). Unfortunately, I was told that cat Adobe does not support LR 6 and I am directed to ask my questions here.

    Thanks a lot again!

Maybe you are looking for