src/map_asn1.h
author Neal H. Walfield <neal@pep.foundation>
Wed, 08 May 2019 12:20:37 +0200
branchemail_comparison
changeset 3649 1dd837adc30b
parent 1513 e7f7e42385b5
child 4186 9fbd6672b600
permissions -rw-r--r--
Fix public key.
     1 // This file is under GNU General Public License 3.0
     2 // see LICENSE.txt
     3 
     4 #pragma once
     5 
     6 #include "pEpEngine.h"
     7 #include "identity_list.h"
     8 #include "../asn.1/Identity.h"
     9 #include "../asn.1/IdentityList.h"
    10 
    11 #ifdef __cplusplus
    12 extern "C" {
    13 #endif
    14 
    15 
    16 // Identity_from_Struct() - convert pEp_identity into ASN.1 Identity_t
    17 //
    18 //  params:
    19 //      ident (in)          pEp_identity to convert
    20 //      result (inout)      Identity_t to update or NULL to alloc a new one
    21 //
    22 //  return value:
    23 //      pointer to updated or allocated result
    24 //
    25 //  caveat:
    26 //      if a new struct is allocated, the ownership goes to the caller
    27 
    28 Identity_t *Identity_from_Struct(
    29         const pEp_identity *ident,
    30         Identity_t *result
    31     );
    32 
    33 
    34 // Identity_to_Struct() - convert ASN.1 Identity_t into pEp_identity
    35 //
    36 //  params:
    37 //      ident (in)          Identity_t to convert
    38 //      result (inout)      pEp_identity to update or NULL to alloc a new one
    39 //
    40 //  return value:
    41 //      pointer to updated or allocated result
    42 //
    43 //  caveat:
    44 //      if a new struct is allocated, the ownership goes to the caller
    45 
    46 pEp_identity *Identity_to_Struct(Identity_t *ident, pEp_identity *result);
    47 
    48 
    49 // IdentityList_from_identity_list() - convert identity_list_t into ASN.1 IdentityList_t
    50 //
    51 //  params:
    52 //      list (in)           identity_list to convert
    53 //      result (inout)      IdentityList_t to update or NULL to alloc a new one
    54 //
    55 //  return value:
    56 //      pointer to updated or allocated result
    57 //
    58 //  caveat:
    59 //      if a new struct is allocated, the ownership goes to the caller
    60 
    61 IdentityList_t *IdentityList_from_identity_list(
    62         const identity_list *list,
    63         IdentityList_t *result
    64     );
    65 
    66 // IdentityList_to_identity_list() - convert ASN.1 IdentityList_t to identity_list_t
    67 //
    68 //  params:
    69 //      list (in)           ASN.1 IdentityList_t to convert
    70 //      result (inout)      identity_list_t to update or NULL to alloc a new one
    71 //
    72 //  return value:
    73 //      pointer to updated or allocated result
    74 //
    75 //  caveat:
    76 //      if a new struct is allocated, the ownership goes to the caller
    77 
    78 identity_list *IdentityList_to_identity_list(IdentityList_t *list, identity_list *result);
    79 
    80 #ifdef __cplusplus
    81 }
    82 #endif
    83