Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

was stimmt nicht?

Empfohlene Antworten

Veröffentlicht

wieso ist die mit folgendem Code generierte Zufahlszahl immer

"-127" ??


byte Zufallszahl

....

...

.....

MFC35Codes bsp = new MFC35Codes();

byte Zufallszahl = bsp.getAskRandomByte();

System.out.println ("\n Random Byte:" + Zufallszahl);

Hallo,

was sind denn MFC35Codes?

Gruß Jaraz

Dieses Ding ist eine Standard Klasse ...


com.ibm.opencard.service 

Class MFC35Codes

java.lang.Object

  |

  +--com.ibm.opencard.service.MFC35Codes


Direct Known Subclasses: 

MFC40SigCodes, MFC41Codes 

Die Klasse gehört zu dem OCF (OpenCardFramework) und soll mit der Methode getAskRandomByte rein theoretisch in der lage sein eine Zufallszahl aus der Chipkarte zu holen... aber das geht nett. :confused:

Muss man Zufallszahlen nicht vorher initialisieren?

Also wenn ich in einen JAVA Programm wäre wahrscheinlich, jedoch soll mir ja die Chipkarte eine Zufallszahl lieferen. Also das heißt ich schicke Ihr nur den Befehl : GEBE ZUFALLSZAHL und ich müßte als Response eine eigenständig berechnete erhalten. Ich habe nichts mit der Berechnung zu tun.

Ich hab auch nicht behauptet, dass du die Zufallszahl(en) selbst berechnen sollst/musst!

Ich wollte nur damit sagen, dass bei deiner Klasse vielleicht ein weiterer Methoden-Aufruf von nöten ist, um die Zufallszahlen zu initialisieren.

Beim java.security.MessageDigest wäre das mit .setSeed(long) möglich.

Da ich aber deine Klasse nicht kenne, ist das eine reine Vermutung.

MfG

Dalton

Hab es geschafft. Mit diesem Command bringt man die Karte dazu eine Zufallszahl auszuspucken....


PassThruCardService cs = (PassThruCardService)

sm.getCardService(PassThruCardService.class, true);


 ///COMMAND

CommandAPDU cmd = new CommandAPDU(20);

    cmd.setLength(0);

    cmd.append((byte) 0x00);

    cmd.append((byte) 0x84);

    cmd.append((byte) 0x00);

    cmd.append((byte) 0x00);

    cmd.append((byte) 0x08); 


System.out.print("Command 'STATUS':");

System.out.println(cmd.toString());


//System.out.print("Sending a 'STATUS' command to the card...");

ResponseAPDU resp = cs.sendCommandAPDU(cmd);

System.out.print("\nResponse to 'STATUS' command:");

System.out.print(resp.toString());

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.