Blame doc/man7/ossl_store.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
ossl_store - Store retrieval functions
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
=for comment generic
Packit c4476c
Packit c4476c
#include <openssl/store.h>
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
=head2 General
Packit c4476c
Packit c4476c
A STORE is a layer of functionality to retrieve a number of supported
Packit c4476c
objects from a repository of any kind, addressable as a file name or
Packit c4476c
as a URI.
Packit c4476c
Packit c4476c
The functionality supports the pattern "open a channel to the
Packit c4476c
repository", "loop and retrieve one object at a time", and "finish up
Packit c4476c
by closing the channel".
Packit c4476c
Packit c4476c
The retrieved objects are returned as a wrapper type B<OSSL_STORE_INFO>,
Packit c4476c
from which an OpenSSL type can be retrieved.
Packit c4476c
Packit c4476c
=head2 URI schemes and loaders
Packit c4476c
Packit c4476c
Support for a URI scheme is called a STORE "loader", and can be added
Packit c4476c
dynamically from the calling application or from a loadable engine.
Packit c4476c
Packit c4476c
Support for the 'file' scheme is built into C<libcrypto>.
Packit c4476c
See L<ossl_store-file(7)> for more information.
Packit c4476c
Packit c4476c
=head2 UI_METHOD and pass phrases
Packit c4476c
Packit c4476c
The B<OSS_STORE> API does nothing to enforce any specific format or
Packit c4476c
encoding on the pass phrase that the B<UI_METHOD> provides.  However,
Packit c4476c
the pass phrase is expected to be UTF-8 encoded.  The result of any
Packit c4476c
other encoding is undefined.
Packit c4476c
Packit c4476c
=head1 EXAMPLES
Packit c4476c
Packit c4476c
=head2 A generic call
Packit c4476c
Packit c4476c
 OSSL_STORE_CTX *ctx = OSSL_STORE_open("file:/foo/bar/data.pem");
Packit c4476c
Packit c4476c
 /*
Packit c4476c
  * OSSL_STORE_eof() simulates file semantics for any repository to signal
Packit c4476c
  * that no more data can be expected
Packit c4476c
  */
Packit c4476c
 while (!OSSL_STORE_eof(ctx)) {
Packit c4476c
     OSSL_STORE_INFO *info = OSSL_STORE_load(ctx);
Packit c4476c
Packit c4476c
     /*
Packit c4476c
      * Do whatever is necessary with the OSSL_STORE_INFO,
Packit c4476c
      * here just one example
Packit c4476c
      */
Packit c4476c
     switch (OSSL_STORE_INFO_get_type(info)) {
Packit c4476c
     case OSSL_STORE_INFO_X509:
Packit c4476c
         /* Print the X.509 certificate text */
Packit c4476c
         X509_print_fp(stdout, OSSL_STORE_INFO_get0_CERT(info));
Packit c4476c
         /* Print the X.509 certificate PEM output */
Packit c4476c
         PEM_write_X509(stdout, OSSL_STORE_INFO_get0_CERT(info));
Packit c4476c
         break;
Packit c4476c
     }
Packit c4476c
 }
Packit c4476c
Packit c4476c
 OSSL_STORE_close(ctx);
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<OSSL_STORE_INFO(3)>, L<OSSL_STORE_LOADER(3)>,
Packit c4476c
L<OSSL_STORE_open(3)>, L<OSSL_STORE_expect(3)>,
Packit c4476c
L<OSSL_STORE_SEARCH(3)>
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut