EldoS | Feel safer!

Software components for data protection, secure storage and transfer

storing data objects on smart card token

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#13662
Posted: 06/15/2010 03:20:44
by Tomislav Jakopović (Basic support level)
Joined: 05/22/2010
Posts: 38

Quote
Innokentiy Ivanov wrote:
Let's try to investigate the issue from another side. Do you have a token with some data object(s) already created? Or, alternatively, are you able to create data objects with some third-party tools?


Hi,

Im using opensc pkcs11 driver, and I have managed to write and read data using their pkcs11-tool from the command line.

Quote

pkcs11-tool --label "test" --type data --write-object a.txt --private --login --pin 00000000
#13665
Posted: 06/15/2010 07:01:37
by Tomislav Jakopović (Basic support level)
Joined: 05/22/2010
Posts: 38

I probably have to provide a few attributes , --private, --modifiable and such...

what's the proper way of doing this?
#13667
Posted: 06/15/2010 07:15:17
by Ken Ivanov (EldoS Corp.)

The above command corresponds to the following SBB code:

Code
TElPKCS11AttributeList attrs = new TElPKCS11AttributeList();
attrs.Add(SBPKCS11Common.Unit.CKA_LABEL, SBUtils.Unit.BytesOfString("MyDataObject"));
info.AddObject(TSBPKCS11ObjectType.otData, true, true, true /* or false */, attrs);
#13669
Posted: 06/15/2010 07:41:54
by Tomislav Jakopović (Basic support level)
Joined: 05/22/2010
Posts: 38

Quote
Innokentiy Ivanov wrote:
TElPKCS11AttributeList attrs = new TElPKCS11AttributeList(); attrs.Add(SBPKCS11Common.Unit.CKA_LABEL, SBUtils.Unit.BytesOfString("MyDataObject")); info.AddObject(TSBPKCS11ObjectType.otData, true, true, true /* or false */, attrs);


same error happens...I have also used TrueCrypt application with the same opensc library writing and deleting objects with no problem...

maybe I should open a new session object from the token, apart from the one Im using to manipulate certificate storages?
#13670
Posted: 06/15/2010 07:55:57
by Tomislav Jakopović (Basic support level)
Joined: 05/22/2010
Posts: 38

I ask becouse Im using a session info object from TElPKCS11CertStorage.openSession method
#13671
Posted: 06/15/2010 08:07:50
by Ken Ivanov (EldoS Corp.)

1) Did you try passing true and false to the Modifiable parameter?

2) Please try to create the object with the following call as well:
Code
attrs.Add(SBPKCS11Common.Unit.CKA_LABEL, SBUtils.Unit.BytesOfString("MyDataObject"));
attrs.Add(SBPKCS11Common.Unit.CKA_PRIVATE, true);
info.AddObject(TSBPKCS11ObjectType.otData, true, attrs);
#13672
Posted: 06/15/2010 08:08:36
by Ken Ivanov (EldoS Corp.)

Follow-up -- there is no problem is using the same session object for certificate and data objects operations.
#13673
Posted: 06/15/2010 08:12:01
by Tomislav Jakopović (Basic support level)
Joined: 05/22/2010
Posts: 38

Quote
Innokentiy Ivanov wrote:
Follow-up -- there is no problem is using the same session object for certificate and data objects operations.


Hm I tried getting the SessionInfo object not from the certificate storage object, but from TElPKCS11Manager object.Can this work?
#13674
Posted: 06/15/2010 08:20:52
by Tomislav Jakopović (Basic support level)
Joined: 05/22/2010
Posts: 38

Quote
Innokentiy Ivanov wrote:
1) Did you try passing true and false to the Modifiable parameter?

2) Please try to create the object with the following call as well:
Code
attrs.Add(SBPKCS11Common.Unit.CKA_LABEL, SBUtils.Unit.BytesOfString("MyDataObject"));
attrs.Add(SBPKCS11Common.Unit.CKA_PRIVATE, true);
info.AddObject(TSBPKCS11ObjectType.otData, true, attrs);


1)Yes, same thing happens.
2)Same thing happens.


Maybe there is something wrotk with sessionInfo object?
#13675
Posted: 06/15/2010 08:24:44
by Tomislav Jakopović (Basic support level)
Joined: 05/22/2010
Posts: 38

I have tried almost everything,changing parameter calls, and still the same error.

When I google this error indicates that something is wrong with the attributes of custom data object to store...

i can read this objects but cant write or modify...
Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.

Reply

Statistics

Topic viewed 5214 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!