Hello,
On Sep 28, 2010, at 3:30 PM, Andre Zepezauer wrote:
> personally I would like to keep this patch specific to the separation of
> attributes from (public) TokenInfo and (internal) sc_pkcs15_card
> structure. Fixing the use of tokeninfo->version is another task and
> therefore I would suggest a separate patch for that one.
Fine.

> The matter of renaming the flags related to TokenInfo sounds easy at
> first. But trying to do it the right way has taken some time. Here is
> what I found:
> 
> 1. Every data type directly related to PKCS#15 is prefixed with
> sc_pkcs15. Upper case is used for constants.
> 2. Every function operating on data types from 1) is prefixed with
> sc_pkcs15 too.
> 
> 3. Two conventions are used for the naming of PKCS#15 flags:
>   a) [SC_PKCS15] + [name of ASN1 type with last letter stripped] + [name of 
> flag]
>      (i.e. SC_PKCS15_PIN_FLAG_CASE_SENSITIVE)
>   b) [SC_PKCS15] + [PR + name of ASN1 type with "FLAGS" stripped] + [name of 
> flag]
>      (i.e. SC_PKCS15_PRKEY_USAGE_ENCRYPT, SC_PKCS15_PRKEY_ACCESS_EXTRACTABLE
> 
> 4. Everything dealing with card I/O has prefix of "sc" but not "sc_pkcs15"
> 
> Conclusion: For the new names of flags, I would prefer convention b) but 
> without the misleading "PR" letters. For example SC_PKCS15_TOKEN_READONLY.
Yes, that would make sense. 

The PR prefix should refer to PRivate I guess, even though the flags are common 
to all key objects.
That has been around since r31 [1], feel free to correct this as well whenever 
you have the time.

[1] 
http://www.opensc-project.org/opensc/browser/trunk/src/libopensc/pkcs15.h?rev=31#L96
-- 
@MartinPaljak.net
+3725156495

_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to