Skip to main content
Graduate
February 17, 2025
Solved

Read GnuPG card with STM32

  • February 17, 2025
  • 2 replies
  • 506 views

Hello.

I have  to develop a project with Riverdi STM embedded display (that uses STM32H757).

 

In this project I have to read the USER NAME and the SERIAL NUMBER of GnuPG smart card.

 

I started from AN4800 that is for GSM File system Smart Card but I don't understand how it works.

 

I search on internet and GnuPG card is used by this library git.gnupg.org Git - gnupg.git/summary .

 

Can someone support me?

 

Someone has tried to use GnuPG card?

 

Thankyou in advice.

 

 

 

 

 

    This topic has been closed for replies.
    Best answer by mƎALLEm

    @MauFanGilaMedical wrote:

    Ok, my card is T1 type because I run the example "\ SmartCardAN4800 \ AN4800_FW_V1.0.0" and it ends into HardFault_Handler because of zero division due to "sc_freq" value.


    As I can see from the code sc_freq is an input to the function, so need to fill it with the smart card frequency in Hz.

     


    @MauFanGilaMedical wrote:

    So, what APDU sequence I have to send?


    Need to contact the SmartCard manufacturer for that. Sorry I cannot help you on this.

    2 replies

    Technical Moderator
    February 17, 2025

    Hello,

    Need to know which type of protocol your SmartCard follows, T=0 or T=1.

    The structure of T=0:

    SofLit_0-1739784206058.png

    For T=1 protocol is more complex and it manages large data transfer.

    So you need from you to understand how your Smart Card is operating. There is no other solution. Read again carefully the application note AN4800 and also AN4100.

    Graduate
    February 17, 2025

     

    I have already read AN4800 (hope enough carefully),

     

    but  AN4100 is older than the other, isn't it ?

     

    Ok, my card is T1 type because I run the example "\ SmartCardAN4800 \ AN4800_FW_V1.0.0" and it ends into HardFault_Handler because of zero division due to "sc_freq" value.

    MauFanGilaMedical_0-1739787154010.png

     

    But I have some dubt: the example that you give is for GSM File system card type.

     

    My card is GnuPG type and I have to read the CardHolder Name

     

    MauFanGilaMedical_1-1739787424686.png

    that has 0x005B as tag and is under the 0x0065-tag directory.

     

    So, what APDU sequence I have to send?

     

    I'm newer in Smart Card and GnuPG.

     

    Thankyou.

     

     

    mƎALLEmAnswer
    Technical Moderator
    February 17, 2025

    @MauFanGilaMedical wrote:

    Ok, my card is T1 type because I run the example "\ SmartCardAN4800 \ AN4800_FW_V1.0.0" and it ends into HardFault_Handler because of zero division due to "sc_freq" value.


    As I can see from the code sc_freq is an input to the function, so need to fill it with the smart card frequency in Hz.

     


    @MauFanGilaMedical wrote:

    So, what APDU sequence I have to send?


    Need to contact the SmartCard manufacturer for that. Sorry I cannot help you on this.