=pod =head1 NAME provider-object - A specification for a provider-native object abstraction =head1 SYNOPSIS =for openssl multiple includes #include #include =head1 DESCRIPTION The provider-native object abstraction is a set of L keys and values that can be used to pass provider-native objects to OpenSSL library code or between different provider operation implementations with the help of OpenSSL library code. The intention is that certain provider-native operations can pass any sort of object that belong with other operations, or with OpenSSL library code. An object may be passed in the following manners: =over 4 =item 1. I This means that the I is passed as an octet string or an UTF8 string, which can be handled in diverse ways by other provided implementations. The encoding of the object depends on the context it's used in; for example, L allows multiple encodings, depending on existing decoders. If central OpenSSL library functionality is to handle the data directly, it B be encoded in DER for all object types except for B (see L below), where it's assumed to a plain UTF8 string. =for comment A future extension might be to be able to specify encoding as a separate parameter. =item 2. I This means that the I isn't passed directly, an I is passed instead. It's an octet string that only the correct provider understands correctly. =back Objects I can be used by anything that handles DER encoded objects. Objects I need a higher level of cooperation from the implementation where the object originated (let's call it X) and its target implementation (let's call it Y): =over 4 =item 1. I The target implementation (Y) may have a function that can take an I. This can only be used if the target implementation is from the same provider as the one originating the object abstraction in question (X). The exact target implementation to use is determined from the I and possibly the I. For example, when the OpenSSL library receives an object abstraction with the I B, it will fetch a L using the I as its key type (the second argument in L). =item 2. I The originating implementation (X) may have an exporter function. This exporter function can be used to export the object in L form, that can then be imported by the target implementation's imported function. This can be used when it's not possible to fetch the target implementation (Y) from the same provider. =back =head2 Parameter reference A provider-native object abstraction is an L with a selection of the following parameters: =over 4 =item "data" (B) or The object data I. =item "reference" (B) The object data I. =item "type" (B) The I, a number that may have any of the following values (all defined in F<< >>): =over 4 =item B The object data may only be I, and should be a UTF8 string. This is useful for L when a URI load results in new URIs. =item B The object data is suitable as provider-native B key data. The object data may be I or I. =item B The object data is suitable as B data. The object data for this object type can only be I, and should be an octet string. Since there's no provider-native X.509 object, OpenSSL libraries that receive this object abstraction are expected to convert the data to a B object with d2i_X509(). =item B The object data is suitable as B data. The object data can only be I, and should be an octet string. Since there's no provider-native X.509 CRL object, OpenSSL libraries that receive this object abstraction are expected to convert the data to a B object with d2i_X509_CRL(). =back =item "data-type" (B) The specific type of the object content. Legitimate values depend on the object type; if it is B, the data type is expected to be a key type suitable for fetching a L that can handle the data. =for comment For objects with an unknown object type (OSSL_OBJECT_PARAM_TYPE is either missing or has the value OSSL_OBJECT_UNKNOWN), libcrypto interprets the object data type as the input type for a decoder. =item "data-structure" (B) The outermost structure of the object content. Legitimate values depend on the object type. =item "desc" (B) A human readable text that describes extra details on the object. =back When a provider-native object abtraction is used, it I contain object data in at least one form (object data I, i.e. the "data" item, or object data I, i.e. the "reference" item). Both may be present at once, in which case the OpenSSL library code that receives this will use the most optimal variant. For objects with the object type B, that object type I be given. =head1 SEE ALSO L, L =head1 HISTORY The concept of providers and everything surrounding them was introduced in OpenSSL 3.0. =head1 COPYRIGHT Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at L. =cut