after I have established a connection with pkcs#11 login to my token USB I have the necessity to check the certificate alias, in particular the "extension" of the Bit4id token (I attacched you a screenshot of what I need, in red square).

That screenshot is taken from the explore's certificate of Mozilla Firefox, and is the detailed window of 1 of the 2 certificates on board of the token USB.

Actually I cant find inside telx509Certificate class, a property that can help me :

I have tried Telx509Certificate.GetFriendlyName but returned an empty string

Indeed, there is no simple way to match ObjectLabel to the corresponding TElX509Certificate object. I believe the only technically feasible way at the moment is to iterate over TElPKCS11CertStorage.Objects[] list and compare binary forms of PKCS#11 certificate objects (TElPKCS11X509CertificateObject.Value) with that of your particular TElX509Certificate instance (TElX509Certificate.CertificateBinary/CertificateSize). This is obviously not the best approach in the world due to its heaviness and a perspective of a mix up if several identical certificates with different labels are stored on the same token.

I believe we'll manage to squeeze in a new property to TElX509Certificate class which would allow to read the label right from the certificate object.

Quote

where I can find the documentation about the exception raised with TElPKCS11SlotInfo and TElPKCS11SessionInfo class, for istance "Token not present" "Wrong PIN" etc?

All PKCS#11-specific exceptions thrown by PKCS#11 components are of EElPKCS11Error type. PKCS#11 defines a set of well-defined error codes, which you can read from the exception's ErrorCode parameter. I'm enclosing the complete list below:

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.