$ ./src/tools/pkcs15-tool -D
...
Public EC Key [My first EC key]
Object Flags : [0x0]
Usage : [0x0]
Access Flags : [0x2], extract
FieldLength : 256
Key ref : 0 (0x0)
Native : no
ID : foobar
DirectValue : <present>
Trying to generate a key with latest upstream code:
$ ./src/tools/pkcs11-tool --module opensc-pkcs11.so -l --keypairgen --key-type EC:prime256v1 --label "My first EC key"
Using slot 1 with a present token (0x1)
Logging in to "SmartCard-HSM (UserPIN)".
Please enter User PIN:
error: PKCS11 function C_GenerateKeyPair failed: rv = CKR_FUNCTION_NOT_SUPPORTED (0x54)
I did some tests with the latest Git code and something interesting is happening:
Generating a key with Ubuntu packages (0.13.0- 3ubuntu4. 1):
$ pkcs11-tool --module opensc-pkcs11.so -l --keypairgen --key-type EC:prime256v1 --label "My first EC key" ffd349158919584 cf51915e047784a 81a18b3b33804dc 318eb0f85608c84 f242cba6e88462e d95d15666e0f526 59a0abe80b8a026 1e30c5b1eab24f8 0fb alue(EC_ PARAMS) failed: rv = CKR_ATTRIBUTE_ TYPE_INVALID (0x12)
Using slot 1 with a present token (0x1)
Logging in to "SmartCard-HSM (UserPIN)".
Please enter User PIN:
Key pair generated:
Private Key Object; EC
label: My first EC key
ID: foobar
Usage: decrypt, sign, unwrap
Public Key Object; EC EC_POINT 264 bits
EC_POINT: 0443044104eb915
warning: PKCS11 function C_GetAttributeV
label: My first EC key
ID: foobar
Usage: encrypt, verify, wrap
$ pkcs15-tool -D
...
Private EC Key [My first EC key]
...
But no public key.
Now using pkcs15-tool from upstream Git:
$ ./src/tools/ pkcs15- tool -D
...
Public EC Key [My first EC key]
Object Flags : [0x0]
Usage : [0x0]
Access Flags : [0x2], extract
FieldLength : 256
Key ref : 0 (0x0)
Native : no
ID : foobar
DirectValue : <present>
Trying to generate a key with latest upstream code:
$ ./src/tools/ pkcs11- tool --module opensc-pkcs11.so -l --keypairgen --key-type EC:prime256v1 --label "My first EC key" NOT_SUPPORTED (0x54)
Using slot 1 with a present token (0x1)
Logging in to "SmartCard-HSM (UserPIN)".
Please enter User PIN:
error: PKCS11 function C_GenerateKeyPair failed: rv = CKR_FUNCTION_
Aborting.