/* verify key */
#include <stdio.h>
#include "scrw.h"

main()
{
  int r1, r2, fd, n, err;
  char buf[8];
  char key[8] = {0x47, 0x46, 0x58, 0x49, 0x32, 0x56, 0x78, 0x40};
  char create_buf[40] = {0xFF, 0xFF, 0x00, 0x40, 0x2e, 0x69, 0x01, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x05, 0x03, 0x00, 0x00, 0x02, 0x00};

  fd = scopen(1, SCODSR, NULL);
  n = screset(fd, buf, &err);
	    
  scwrite(fd, 0xf0, 0x2a, 0x00, 0x01, 0x08, key, &r1, &r2);
  printf("verify_key: smartcard returns %x %x\n", r1, r2);

  scwrite(fd, 0xf0, 0xe0, 0x00, 0x01, 0x12, create_buf, &r1, &r2);
  printf("create_file: smartcard returns %x %x\n", r1, r2);
  scclose(fd);
}
