RE: Object Store question
[email protected] Thu, 3 Feb 2000 08:48:05 -0500
| Newsgroups | gmane.ietf.pfl |
|---|---|
| Message-ID | <[email protected]> |
Ravi, Glad you got it built. If you need to store BLOBs in the ObjectStore, via the ObjectCache, I think what Mike suggested (encapsulate your BLOBs inside asn_octetstring objects) is simplest. You would have to extend the ObjStoreData type, defined in src\asn1\ObjectDefs.h, to allow the BLOB octetstring as an optional component (the certificate is already optional, so you don't need to change that). You'd also have to decide how code should determine whether an X.509 cert is present, or whether it contains one of your BLOB certs - you could either modify the code to check which component is present, or define a new set of states that indicate the presence of a BLOB cert (the first is better practice, but would involve more hunting through the code). John Tolani Ravi-FRT222 <[email protected]> on 02/02/2000 10:00:05 AM To: "'[email protected]'" <[email protected]> cc: Subject: RE: Object Store question Hi John I was able to get the ostest program to work. The only modification I needed was to insert some member operators .value to get to the correct members. Mike Shanzer had suggested that I need to store the BLOB certificates as ASN1 encoded octet strings. Would it be possible to modify the ObjectCache class to hold BLOB certificates which are not ASN1 encoded. Thanks again for your help Ravi -----Original Message----- From: [email protected] [mailto:[email protected]] Sent: Tuesday, February 01, 2000 1:43 PM To: Tolani Ravi-FRT222 Cc: Jonah Mailing List (E-mail) Subject: RE: Object Store question The lower levels of the ObjectStore (objectstore.h/cpp and qdisam.h/cpp) don't require that the objects you put in the ObjectStore are encoded in ASN.1 (they do use the buffer_t objects that are defined in the ASN.1 header files, so you have to build and link against the asn.1 classes, but the data you're storing doesn't have to be in asn.1). In Jonah, the ObjectStore is cached via a layer called the ObjectCache, which does require that the objects are asn.1 encoded (one purpose of the ObjectCache is to minimize the number of asn.1 encode/decode operations that have to be performed, so it caches the objects in their parsed state). The layering is pretty simple. From bottom to top: o QDISAM is a pretty general purpose storage system that lets you store arbitrary sized records into a file, assigning an integer key to each record. This key is what Jonah calls an ObjectStore ID. o ObjectStore just puts an O-O wrapper around qdisam, and supports some Jonah conventions regarding the encoding of the flag values that can be associated with each ObjectStore record. o ObjectCache maintains an in-memory cache of asn.1-encoded objects, backed by the ObjectStore on-disk store. It also adds some mutexes to single-thread the accesses to the ObjectStore layer (which isn't thread-safe by itself). If you want to use the ObjectStore directly from another project, it should work (provided you don't want to run Jonah against the same ObjectStore, and provided you make sure you aren't invoking operations from multiple threads simultaneously). It looks as though ostest wasn't upgraded when we fixed some tagging bugs in the asn.1 definitions, which is causing the compilation errors you're seeing. But I think it uses the ObjectCache layer anyway, so it's probably not what you want. You could look at osread.cpp, which is a little debugging utility that pulls a record out of the ObjectStore by key, and writes it to a file. It uses the qdisam layer directly (bypassing the ObjectCache and ObjectStore), so it probably is more in-line with what you're looking for. John Tolani Ravi-FRT222 <[email protected]>@imc.org on 02/01/2000 12:18:11 PM Sent by: [email protected] To: "Jonah Mailing List (E-mail)" <[email protected]> cc: Subject: RE: Object Store question Hi I have included my response on the specific error message. -----Original Message----- From: Mike Shanzer [mailto:[email protected]] Sent: Tuesday, February 01, 2000 7:13 AM To: Ravi.Tolani Subject: Re: Object Store question Ravi Tolani wrote: > > Hi > I am trying to using the objectStore in a project and was wondering > if someone could shed some light on its use. Is it possible to use the > ObjectStore to store binary data which is not ASN1 encoded. I would like > to use the store to manage certain certificates which comprise of a BLOB > of data. The way the object store is currently set up the the actual data does need to be asn.1 encoded. If you want to store a blob of data you can store it as an asn.1 encoded octetstring. > Also, I was able to compile the ObjectStore as a seperate dll but have > been unable to compile the ostest.cpp program which resides in the same > directory as ObjectStore. Has anyone been able to get it to work What was the error you were getting? we never tried to do this, but I do not see what it would not work. There might be some dependencies on things in OSSRV and of course asn.1. Here is my response. I am getting a compile time error when I try to compile the ostest.cpp file. I have appended my response at the end. Apparently it is becuase it cannot find the definitions of the members of ObjStoreData which have been explicitly instantiated. Thanks for your help -------------------Configuration: ObjectStoreTest - Win32 Debug-------------------- Compiling... ostest.cpp D:\WTLS\ObjectStore\ostest.cpp(104) : error C2039: 'directoryname' : is not a member of 'asn_explicit<class GeneralName,2,1>' D:\WTLS\ObjectStore\ostest.cpp(104) : error C2228: left of '.set_value_UTF8' must have class/struct/union type D:\WTLS\ObjectStore\ostest.cpp(105) : error C2039: 'select' : is not a member of 'asn_explicit<class GeneralName,2,1>' D:\WTLS\ObjectStore\ostest.cpp(106) : error C2039: 'set_value' : is not a member of 'asn_explicit<class asn_ia5String,2,2>' D:\WTLS\ObjectStore\ostest.cpp(107) : error C2039: 'set_value' : is not a member of 'asn_explicit<class asn_octetstring,2,3>' D:\WTLS\ObjectStore\ostest.cpp(175) : error C2039: 'directoryname' : is not a member of 'asn_explicit<class GeneralName,2,1>' D:\WTLS\ObjectStore\ostest.cpp(175) : error C2228: left of '.set_value_UTF8' must have class/struct/union type D:\WTLS\ObjectStore\ostest.cpp(201) : error C2039: 'directoryname' : is not a member of 'asn_explicit<class GeneralName,2,1>' D:\WTLS\ObjectStore\ostest.cpp(201) : error C2228: left of '.set_value_UTF8' must have class/struct/union type D:\WTLS\ObjectStore\ostest.cpp(228) : error C2039: 'directoryname' : is not a member of 'asn_explicit<class GeneralName,2,1>' D:\WTLS\ObjectStore\ostest.cpp(228) : error C2228: left of '.set_value_UTF8' must have class/struct/union type D:\WTLS\ObjectStore\ostest.cpp(256) : error C2039: 'directoryname' : is not a member of 'asn_explicit<class GeneralName,2,1>' D:\WTLS\ObjectStore\ostest.cpp(256) : error C2228: left of '.set_value_UTF8' must have class/struct/union type Error executing cl.exe. ostest.obj - 13 error(s), 1 warning(s) Mike >