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