Creating data object

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating data object

novakv
Hello,

I am trying to store a data object on Cryptoflex card with  this command:

pkcs15-init -T -W aaa.bin -i 03 -vvvvvvvv

aaa.bin is short binary file with TLV structure.

The command fails with an error, see below. I have installed the
scb 0.3 (Smart card bundle) on WIN XP. What could be wrong?
Also I would like to ask few questions:

1. How can I specify appName?
2. Is it possible to store empty data object? (empty value)

Thank you for your help
Vit Novak

===============================================
encoding 'data'
type=258, tag=0x1000010, parm=0012FB24, len=0
 encoding 'commonObjectAttributes'
 type=129, tag=0x1000010, parm=0012F93C, len=0
  encoding 'label'
  type=12, tag=0x0c, parm=00AA220C, len=11
  length of encoded item=13
  encoding 'flags'
  type=131, tag=0x03, parm=00AA230C, len=4
  length of encoded item=4
  encoding 'authId' (not present)
  length of encoded item=0
  encoding 'userConsent' (not present)
  length of encoded item=0
  encoding 'accessControlRules' (not present)
  length of encoded item=0
 length of encoded item=19
 encoding 'classAttributes'
 type=129, tag=0x1000010, parm=0012FAC0, len=0
  encoding 'appName'
  type=12, tag=0x0c, parm=00AA253C, len=11
  length of encoded item=13
  encoding 'appOID'
  type=6, tag=0x06, parm=00AA263C, len=0
cannot encode empty non-optional ASN.1 object
encoding of ASN.1 object 'classAttributes' failed: Invalid ASN.1 object
encoding of ASN.1 object 'data' failed: Invalid ASN.1 object
Failed to store data object: Invalid ASN.1 object
card.c:488:sc_unlock: called
Calling card logout function
card.c:229:sc_transmit_apdu: called
Sending 4 bytes (resp. 2 bytes):
F0 22 07 00 ."..
Received 0 bytes (SW1=90 SW2=00)
card-flex.c:1321:flex_logout: returning with: 0
card.c:443:sc_disconnect_card: called
card.c:458:sc_disconnect_card: returning with: 0
ctx.c:618:sc_release_context: called

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Creating data object

Stef Hoeben
Hi,

[hidden email] wrote:

>Hello,
>
>I am trying to store a data object on Cryptoflex card with  this command:
>
>pkcs15-init -T -W aaa.bin -i 03 -vvvvvvvv
>
>aaa.bin is short binary file with TLV structure.
>  
>


>The command fails with an error, see below. I have installed the
>scb 0.3 (Smart card bundle) on WIN XP. What could be wrong?
>Also I would like to ask few questions:
>
>1. How can I specify appName?
>  
>
You should use  --application-id  
             pkcs15-init -T -W aaa.bin --application-id 1.2.3

(Note: the ApplicationOID is optional according to the standard, but
appearently
OpenSC requires it -- it seems to be a recent change ?)

>2. Is it possible to store empty data object? (empty value)
>  
>
It seems to be card-dependent. On a cryptoflex, you can seem to create
an empty
file so it doesn't work there. Maybe you have better luck. If not and
you realy need
it, the pkcs15 standard might have to way to get around this.

Cheers,
Stef

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

RE: Creating data object

novakv
In reply to this post by novakv
Thanks for reply,

> >
> You should use  --application-id  
>              pkcs15-init -T -W aaa.bin --application-id 1.2.3
>
> (Note: the ApplicationOID is optional according to the
> standard, but appearently OpenSC requires it -- it seems to
> be a recent change ?)

--application-id fails with 'unrecognized option'. I actually ment Application Name,
whitch is a string (and the only option for PKCS11). The OID is quite useless
if there is no PKCS11 support for it.

Vit Novak
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Creating data object

Stef Hoeben
Hi,

[hidden email] wrote:

>Thanks for reply,
>
>  
>
>>You should use  --application-id  
>>             pkcs15-init -T -W aaa.bin --application-id 1.2.3
>>
>>(Note: the ApplicationOID is optional according to the
>>standard, but appearently OpenSC requires it -- it seems to
>>be a recent change ?)
>>    
>>
>
>--application-id fails with 'unrecognized option'.
>
It's a recent addition, I should work with the current SVN.

>I actually ment Application Name,
>whitch is a string (and the only option for PKCS11). The OID is quite useless
>if there is no PKCS11 support for it.
>
The pkcs15-init tool doesn't support, this right now, but it's easy to
add to pkcs15-init.c,
just look at how --application-id is done. Or let me know if I should
add it (tomorrow evening)?

Cheers,
Stef

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

RE: Creating data object

novakv
In reply to this post by novakv
> >
> The pkcs15-init tool doesn't support, this right now, but
> it's easy to
> add to pkcs15-init.c,
> just look at how --application-id is done. Or let me know if I should
> add it (tomorrow evening)?
>

I thing I can wait for the next release :-)
Have a nice day,
Vit

> Cheers,
> Stef
>
>
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel