]> git.ipfire.org Git - thirdparty/openssl.git/blame - crypto/store/README
Continue standardising malloc style for libcrypto
[thirdparty/openssl.git] / crypto / store / README
CommitLineData
9fc8dc54
RS
1NOTE:
2 This is a planned replacement for X509_STORE.
3 It is incomplete, has compile errors, and is
4 not built as part of the standard configuration.
5
6
a5db6fa5
RL
7The STORE type
8==============
9
10A STORE, as defined in this code section, is really a rather simple
11thing which stores objects and per-object associations to a number
12of attributes. What attributes are supported entirely depends on
13the particular implementation of a STORE. It has some support for
14generation of certain objects (for example, keys and CRLs).
15
16
17Supported object types
18----------------------
19
20For now, the objects that are supported are the following:
21
22X.509 certificate
23X.509 CRL
24private key
25public key
26number
0bd71d3b 27arbitrary (application) data
a5db6fa5
RL
28
29The intention is that a STORE should be able to store everything
30needed by an application that wants a cert/key store, as well as
31the data a CA might need to store (this includes the serial number
32counter, which explains the support for numbers).
33
34
35Supported attribute types
36-------------------------
37
38For now, the following attributes are supported:
39
40Friendly Name - the value is a normal C string
41Key ID - the value is a 160 bit SHA1 hash
42Issuer Key ID - the value is a 160 bit SHA1 hash
43Subject Key ID - the value is a 160 bit SHA1 hash
44Issuer/Serial Hash - the value is a 160 bit SHA1 hash
45Issuer - the value is a X509_NAME
46Serial - the value is a BIGNUM
47Subject - the value is a X509_NAME
48Certificate Hash - the value is a 160 bit SHA1 hash
49Email - the value is a normal C string
50Filename - the value is a normal C string
51
52It is expected that these attributes should be enough to support
53the need from most, if not all, current applications. Applications
54that need to do certificate verification would typically use Subject
55Key ID, Issuer/Serial Hash or Subject to look up issuer certificates.
56S/MIME applications would typically use Email to look up recipient
57and signer certificates.
58
59There's added support for combined sets of attributes to search for,
60with the special OR attribute.
61
62
63Supported basic functionality
64-----------------------------
65
66The functions that are supported through the STORE type are these:
67
68generate_object - for example to generate keys and CRLs
69get_object - to look up one object
70 NOTE: this function is really rather
71 redundant and probably of lesser usage
72 than the list functions
73store_object - store an object and the attributes
74 associated with it
75modify_object - modify the attributes associated with
76 a specific object
77revoke_object - revoke an object
78 NOTE: this only marks an object as
79 invalid, it doesn't remove the object
80 from the database
81delete_object - remove an object from the database
82list_object - list objects associated with a given
83 set of attributes
84 NOTE: this is really four functions:
85 list_start, list_next, list_end and
86 list_endp
87update_store - update the internal data of the store
88lock_store - lock the store
89unlock_store - unlock the store
90
91The list functions need some extra explanation: list_start is
92used to set up a lookup. That's where the attributes to use in
93the search are set up. It returns a search context. list_next
94returns the next object searched for. list_end closes the search.
95list_endp is used to check if we have reached the end.
96
97A few words on the store functions as well: update_store is
98typically used by a CA application to update the internal
99structure of a database. This may for example involve automatic
100removal of expired certificates. lock_store and unlock_store
101are used for locking a store to allow exclusive writes.