5 OSSL_STORE_expect - Specify what object type is expected
9 #include <openssl/store.h>
11 int OSSL_STORE_expect(OSSL_STORE_CTX *ctx, int expected_type);
15 OSSL_STORE_expect() helps applications filter what OSSL_STORE_load() returns
16 by specifying a B<OSSL_STORE_INFO> type.
17 For example, if C<file:/foo/bar/store.pem> contains several different objects
18 and only the certificates are interesting, the application can simply say
19 that it expects the type B<OSSL_STORE_INFO_CERT>.
20 All known object types (see L<OSSL_STORE_INFO(3)/SUPPORTED OBJECTS>)
21 except for B<OSSL_STORE_INFO_NAME> are supported.
23 OSSL_STORE_expect() I<must> be called before the first OSSL_STORE_load()
24 of a given session, or it will fail.
28 If a more elaborate filter is required by the application, a better choice
29 would be to use a post-processing function.
30 See L<OSSL_STORE_open(3)> for more information.
32 However, some loaders may take advantage of the knowledge of an expected type
33 to make object retrieval more efficient, so if a single type is expected, this
34 method is usually preferable.
38 OSSL_STORE_expect() returns 1 on success, or 0 on failure.
42 L<ossl_store(7)>, L<OSSL_STORE_INFO(3)>, L<OSSL_STORE_load(3)>
47 was added to OpenSSL 1.1.1.
51 Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
53 Licensed under the OpenSSL license (the "License"). You may not use
54 this file except in compliance with the License. You can obtain a copy
55 in the file LICENSE in the source distribution or at
56 L<https://www.openssl.org/source/license.html>.