Changeset 6e8997e


Ignore:
Timestamp:
05/22/12 13:48:44 (12 months ago)
Author:
Mei <mei@…>
Branches:
mei_rt2, mei_rt2_fix_1
Children:
5d06689
Parents:
adc0815
git-author:
Mei <mei@…> (05/22/12 13:48:44)
git-committer:
Mei <mei@…> (05/22/12 13:48:44)
Message:

1) more changes to the api doc embedded in abac.hh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libabac/abac.hh

    radc0815 r6e8997e  
    1414/***  
    1515ABAC::Constraint 
    16    This is a constraint on a data term. It holds a ptr to 
    17    a abac_condition_t structure  
     16   Constraint on a data term.  
     17   There are 3 types:  
     18     - Role constraint on a principal 
     19     - Oset constraint on a principal, or a data object 
     20     - Range/List constraint on a data object 
     21   It holds a ptr to a abac_condition_t structure  
    1822***/ 
    1923    class Constraint { 
    2024        public: 
    2125/*** 
    22    Constraint() 
     26f  Constraint() 
    2327     default constructor, do not use, for swig only  
    24    Constraint(const Constraint &) 
     28f  Constraint(const Constraint &) 
    2529     copy constructor, used for cloning a constraint 
    26    ~Constraint() 
     30f  ~Constraint() 
    2731     default destructor 
    2832***/ 
     
    3539            } 
    3640/*** 
    37    Constraint(Role &) 
     41f  Constraint(Role &) 
    3842     constructor that takes a constraining role 
    3943       [role:?R[{role-constraint}] 
    40    Constraint(Oset &) 
     44f  Constraint(Oset &) 
    4145     constructor that takes a constraining oset 
    4246       [oset:?O[{oset-constraint}] 
    4347       [urn:?F[keyid:$alpha_keyid].oset:documents([string:?P])] 
    44    Constraint(abac_condition_t *) 
     48f  Constraint(abac_condition_t *) 
    4549     constructor that takes an abac_condition_t structure 
    46    Constraint(char *) 
     50f  Constraint(char *) 
    4751     constructor that takes one of following string 
    4852     as its vartype to set up a range constraint: 
     
    6569            } 
    6670/*** 
    67    void add_constraint_integer_max(int) 
     71f  void add_constraint_integer_max(int) 
    6872   void add_constraint_integer_min(int) 
    6973     utility routines to setup a integer range constraint  
    7074       [integer:?I[10 .. 20]] 
    71    void add_constraint_integer_target(int) 
     75f  void add_constraint_integer_target(int) 
    7276     utility routine to setup a integer list constraint  
    7377       [integer:?I[10,20]] 
     
    8387            } 
    8488/*** 
    85    void add_constraint_float_max(float) 
     89f  void add_constraint_float_max(float) 
    8690   void add_constraint_float_min(float) 
    8791     utility routines to setup a float range constraint  
    8892       [float:?F[1.0 .. 2.5]] 
    89    void add_constraint_float_target(float) 
     93f  void add_constraint_float_target(float) 
    9094     utility routine to setup a float list constraint  
    9195       [float:?F[0.5, 2.5]] 
     
    101105            } 
    102106/*** 
    103    void add_constraint_time_max(char*) 
     107f  void add_constraint_time_max(char*) 
    104108   void add_constraint_time_min(char*) 
    105109     utility routines to setup a time range constraint,  
    106110     takes quoted string values, beyond T is optional  
    107        [time:?M["20201101T182930"]]  
    108        [time:?M["20201101T"]]  
    109    void add_constraint_time_target(char*) 
     111       [time:?F["20120228T" .. "20120228T090000"]] 
     112f  void add_constraint_time_target(char*) 
    110113     utility routine to setup a time list constraint  
    111        [time:?F["20120228T080000" .. "20120228T090000"]] 
     114       [time:?M["20201101T182930","20201101T"]]  
    112115***/ 
    113116            void add_constraint_time_max(char* val) { 
     
    121124            } 
    122125/*** 
    123    void add_constraint_urn_target(char*) 
     126f  void add_constraint_urn_target(char*) 
    124127     utility routine to setup a an urn list constraint 
    125128       [urn:?U["fileA","http://fileB"]]  
    126    void add_constraint_string_target(char*) 
     129f  void add_constraint_string_target(char*) 
    127130     utility routine to setup a a string list constraint 
    128131       [string:?S["abc",'efg',"hij"]] 
    129    void add_constraint_boolean_target(char*) 
     132f  void add_constraint_boolean_target(char*) 
    130133     utility routine to setup a a boolean list constraint 
    131134       [boolean:?B['true']] 
     
    138141            { abac_condition_add_range_boolean_item(m_constraint,val); } 
    139142/*** 
    140    char *string() const 
     143f  char *string() const 
    141144     returns literal string of the constraint 
    142    char *typed_string() const 
     145f  char *typed_string() const 
    143146     returns typed literal string of the constraint 
    144147***/ 
     
    148151            { return abac_condition_typed_string(m_constraint); } 
    149152/*** 
    150    abac_condition_t *constraint() 
     153f  abac_condition_t *constraint() 
    151154     returns internal constraint structure 
    152155***/ 
     
    169172        public: 
    170173/*** 
    171    DataTerm() 
     174f  DataTerm() 
    172175     default constructor, do not use, for swig only  
    173    DataTerm(const DataTerm &) 
     176f  DataTerm(const DataTerm &) 
    174177     copy constructor, used for cloning a data term 
    175    ~DataTerm() 
     178f  ~DataTerm() 
    176179     default destructor 
    177180***/ 
     
    188191            } 
    189192/*** ??? 
    190    DataTerm(abac_term_t *) 
     193f  DataTerm(abac_term_t *) 
    191194     constructor to make data term from abac_term_t structure 
    192195***/ 
     
    198201            } 
    199202/*** 
    200    DataTerm(char*) 
     203f  DataTerm(char*) 
    201204     constructor to make named principal data term for the oset RHS  
    202    DataTerm(char*, char*, Constraint*) 
     205f  DataTerm(char*, char*, Constraint*) 
    203206     constructor for making a variable data term or an instantiated 
    204207     data term 
     
    224227            } 
    225228/*** 
    226    char *string() const 
     229f  char *string() const 
    227230     returns literal string of the data term 
    228    char *typed_string() const 
     231f  char *typed_string() const 
    229232     returns typed literal string of the data term 
    230233***/ 
     
    234237            { return abac_term_typed_string(m_term); } 
    235238/*** 
    236    bool is_time() const 
     239f  bool is_time() const 
    237240   bool is_string() const 
    238241   bool is_urn() const 
     
    249252            { return abac_term_is_integer_type(m_term); } 
    250253/*** 
    251    int add_constraint(const Contraint&) 
     254f  int add_constraint(const Contraint&) 
    252255     utiltiy routine to add a constraint to this data term 
    253256***/ 
     
    257260            } 
    258261/*** 
    259    int type() const 
     262f  int type() const 
    260263     returns subtype of the data term 
    261    char *name() const 
     264f  char *name() const 
    262265     returns the name of the data term  
    263266***/ 
     
    267270            { return abac_term_name(m_term); } 
    268271/*** ??? value  
    269    char *value() const 
     272f  char *value() const 
    270273     Not implemented 
    271274***/ 
    272275            char *value() const { } 
    273276/*** 
    274    abac_term_t *term() 
     277f  abac_term_t *term() 
    275278     returns internal data term structure 
    276    Constraint *constraint() 
     279f  Constraint *constraint() 
    277280     returns internal constraint structure to the data term 
    278281***/ 
     
    289292/*** 
    290293ABAC::Role 
    291    A Role is role specification of a set of entitities for a principal. 
     294   A Role is role specification of a set of entitities for a principal 
    292295***/ 
    293296    class Role { 
    294297        public: 
    295298/*** 
    296    Role() 
     299f  Role() 
    297300     default constructor, do not use, for swig only  
    298    Role(const Role &) 
     301f  Role(const Role &) 
    299302     copy constructor, used for cloning a role 
    300    ~Role() 
     303f  ~Role() 
    301304     default destructor 
    302305***/ 
     
    309312            } 
    310313/*** 
    311    Role(abac_aspect_t*) 
     314f  Role(abac_aspect_t*) 
    312315     constructor that takes an abac_aspect_t structure 
    313    Role(char*)  
     316f  Role(char*)  
    314317     constructor that builds a bare bone role with just principal's name 
    315    Role(char*, char*)  
     318f  Role(char*, char*)  
    316319     constructor that builds a bare bone role with just principal's name 
    317320     and a role name 
     
    326329            { } 
    327330/*** 
    328    bool is_principal() const 
     331f  bool is_principal() const 
    329332     return true if the role is a principal object(made from 
    330333     a data term), the right hand side of,  
     
    334337            { return abac_aspect_is_principal(m_role); } 
    335338/*** 
    336    bool is_linking() const 
     339f  bool is_linking() const 
    337340     returns true if the role is a linking role like 
    338341     the right hand side of, 
     
    342345            { return abac_aspect_is_linking(m_role); } 
    343346/*** 
    344    char *string() const 
     347f  char *string() const 
    345348     returns literal string of the role 
    346    char *typed_string() const 
     349f  char *typed_string() const 
    347350     returns typed literal string of the role 
    348351***/ 
     
    352355            { return abac_aspect_typed_string(m_role); } 
    353356/*** 
    354    char *linked_role() const  
     357f  char *linked_role() const  
    355358     returns linked part of a linking role, for 
    356      [keyid:A].role:r1.role:r2, it returns r1 
     359       [keyid:A].role:r1.role:r2, it returns r1 
    357360***/ 
    358361            char *linked_role() const  
    359362            { return abac_aspect_linked_role_name(m_role); } 
    360363/*** 
    361    char *role_name() const  
     364f  char *role_name() const  
    362365     returns the role name of any role (the part after the last dot) 
    363      [keyid:A].role.r1.role:r2, it returns r2 
    364      [keyid:A].role.r1, it returns r1 
     366       [keyid:A].role.r1.role:r2, it returns r2 
     367       [keyid:A].role.r1, it returns r1 
    365368***/ 
    366369            char *role_name() const 
     
    370373 
    371374/*** 
    372    int add_data_term(DataTerm&) 
     375f  int add_data_term(DataTerm&) 
    373376     add a data term to the role 
    374377***/ 
     
    378381            } 
    379382/*** 
    380    std::vector<DataTerm> get_data_terms(bool &) 
     383f  std::vector<DataTerm> get_data_terms(bool &) 
    381384     return the data terms bound to this role. 
    382385     ??? If the role is returned in a proof, these will all have values. 
     
    399402            } 
    400403/*** 
    401    std::vector<DataTerm> get_linked_data_terms(bool &) 
     404f  std::vector<DataTerm> get_linked_data_terms(bool &) 
    402405     return the data terms bound to this role's linking role. 
    403406     ??? If the role is returned in a proof, these will all have values. 
     
    416419            } 
    417420/*** 
    418    abac_aspect_t *role() 
     421f  abac_aspect_t *role() 
    419422     returns the interal libabac representation of this role 
    420423***/ 
     
    426429/*** 
    427430ABAC::Oset 
    428    An Oset is oset specification of a set of entitities for a principal. 
     431   An Oset is oset specification of a set of entitities for a principal 
    429432***/ 
    430433    class Oset { 
    431434        public: 
    432435/*** 
    433    Oset() 
     436f  Oset() 
    434437     default constructor, do not use, for swig only 
    435    Oset(const Oset &) 
     438f  Oset(const Oset &) 
    436439     copy constructor, used for cloning an oset 
    437    ~Oset() 
     440f  ~Oset() 
    438441     default destructor 
    439442***/ 
     
    444447            { if(m_oset) abac_aspect_free(m_oset); } 
    445448/*** 
    446    Oset(abac_aspect_t *) 
     449f  Oset(abac_aspect_t *) 
    447450     constructor that takes abac_aspect_t structure 
    448    Oset(char *) 
     451f  Oset(char *) 
    449452     constructor that makes a principal oset, ie [keyid:B] 
    450    Oset(char *, char *) 
     453f  Oset(char *, char *) 
    451454     constructor that makes a regular oset, ie. [keyid:B].oset:o 
    452    Oset(DataTerm&) 
     455f  Oset(DataTerm&) 
    453456     constructor that makes an object oset, ie. [urn:'file/fileA'] 
    454457***/ 
     
    465468 
    466469/*** 
    467    bool is_object(), ie <- [integer:10] 
     470f  bool is_object(), ie <- [integer:10] 
    468471     return ture if this oset is an object oset 
    469472***/ 
     
    471474            { return abac_aspect_is_object(m_oset); } 
    472475/*** 
    473    bool is_principal() const 
     476f  bool is_principal() const 
    474477     return true if the oset is a principal object(made from 
    475478     a data term), the right hand side of,  
     
    479482            { return abac_aspect_is_principal(m_oset); } 
    480483/*** 
    481    bool is_linking() const 
     484f  bool is_linking() const 
    482485     returns true if the oset is a linking oset like 
    483486     the right hand side of, 
     
    487490            { return abac_aspect_is_linking(m_oset); } 
    488491/*** 
    489    char *string() const 
     492f  char *string() const 
    490493     returns literal string of the oset 
    491    char *typed_string() const 
     494f  char *typed_string() const 
    492495     returns typed literal string of the oset 
    493496***/ 
     
    497500            { return abac_aspect_typed_string(m_oset); } 
    498501/*** 
    499    char *linked_role() const  
     502f  char *linked_role() const  
    500503     returns linked part of a linking oset, for 
    501      [keyid:A].role:r1.oset:o1, it returns r1 
     504       [keyid:A].role:r1.oset:o1, it returns r1 
    502505***/ 
    503506            char *linked_role() const  
    504507            { return abac_aspect_linked_role_name(m_oset); } 
    505508/*** 
    506    char *oset_name() const  
     509f  char *oset_name() const  
    507510     returns oset name, 
    508      [keyid:A].role:r1.oset:o1, it returns o1 
    509      [keyid:A].oset:o1, it returns o1 
     511       [keyid:A].role:r1.oset:o1, it returns o1 
     512       [keyid:A].oset:o1, it returns o1 
    510513***/ 
    511514            char *oset_name() const 
    512515            { return abac_aspect_aspect_name(m_oset); } 
    513516/*** 
    514    char *principal() const  
     517f  char *principal() const  
    515518     returns principal name, 
    516      [keyid:A].role:r1.oset:o1, it returns A  
     519       [keyid:A].role:r1.oset:o1, it returns A  
    517520***/ 
    518521            char *principal() const 
    519522            { return abac_aspect_principal_name(m_oset); } 
    520523/*** 
    521    char *object() const  
     524f  char *object() const  
    522525     returns object's name when the oset is a principal object 
    523      [keyid:A].oset:values <- [integer:10], it returns 10 
     526       [keyid:A].oset:values <- [integer:10], it returns 10 
    524527***/ 
    525528            char *object() const  
    526529            { return abac_aspect_object_name(m_oset); } 
    527530/*** 
    528    int add_data_term(DataTerm&) 
     531f  int add_data_term(DataTerm&) 
    529532     add a data term to this oset's parameter set 
    530533     always returns 1 
     
    535538            } 
    536539/*** 
    537    std::vector<DataTerm> get_data_terms(bool &) 
     540f  std::vector<DataTerm> get_data_terms(bool &) 
    538541     returns the data terms bound to this oset.   
    539542     ??? If the oset is returned in a proof, these will all have values. 
     
    552555            } 
    553556/*** 
    554    int add_linking_data_term(DataTerm&) 
     557f  int add_linking_data_term(DataTerm&) 
    555558     add a data term to this oset's linking role's parameter set. 
    556559     always returns 1 
     
    561564            } 
    562565/*** 
    563    std::vector<DataTerm> get_linked_data_terms(bool &) 
     566f  std::vector<DataTerm> get_linked_data_terms(bool &) 
    564567     returns the data terms bound to this oset's linking role.   
    565568     ??? If the oset is returned in a proof, these will all have values. 
     
    578581            } 
    579582/*** 
    580    abac_aspect_t *oset() 
     583f  abac_aspect_t *oset() 
    581584     returns the internal libabac representation of the oset 
    582585***/ 
     
    596599        public: 
    597600/*** 
    598    ID() 
     601f  ID() 
    599602     default constructor, do not use, for swig only 
    600    ID(const ID &) 
     603f  ID(const ID &) 
    601604     copy constructor, used for cloning an ID 
    602    ~ID() 
     605f  ~ID() 
    603606     default destructor 
    604607***/ 
     
    607610            ~ID() { if(m_id) abac_id_free(m_id); } 
    608611/*** ??? 
    609    ID(abac_id_t *) 
     612f  ID(abac_id_t *) 
    610613     constructor from abac_id_t 
    611    ID(abac_id_credential_t *) 
     614f  ID(abac_id_credential_t *) 
    612615     constructor from abac_id_t 
    613616***/ 
     
    621624 
    622625/***  
    623    ID(char *) 
     626f  ID(char *) 
    624627     load an ID cert from a file, will throw an exception  
    625628     if the cert cannot be loaded  
     
    631634            } 
    632635/***  
    633    ID(char *,int) 
     636f  ID(char *,int) 
    634637     generates a new ID with the supplied CN and validity period 
    635638     - CN must be alphanumeric and begin with a letter 
     
    643646            } 
    644647/***  
    645    void load_privkey(char *) 
     648f  void load_privkey(char *) 
    646649     loads the private key associated with the ID credential 
    647650     will throw an exception if the key cannot be loaded  
     
    653656            } 
    654657/*** 
    655    abac_id_t *id() 
     658f  abac_id_t *id() 
    656659     returns the abac_id_t  
    657660     returns the interal libabac representation of this id 
     
    660663 
    661664/*** 
    662    char *keyid() 
     665f  char *keyid() 
    663666     returns the SHA1 keyid of the id cert 
    664    char *name() 
     667f  char *name() 
    665668     returns the CN (the parameter passed to the constructor or the 
    666669     CN of the cert). 
     
    669672            char *name() { return abac_id_cn(m_id); } 
    670673/*** 
    671    bool has_privkey() 
     674f  bool has_privkey() 
    672675     returns true if the ID has an associated private key 
    673676***/ 
     
    676679 
    677680/*** 
    678    void write_cert(FILE *) 
     681f  void write_cert(FILE *) 
    679682     writes a PEM-encoded cert to the file handle  
    680    void write_cert(char *) 
     683f  void write_cert(char *) 
    681684     writes a PEM-encoded cert to a file named out  
    682685***/ 
     
    689692            } 
    690693/*** 
    691    void write_privkey(FILE *) 
     694f  void write_privkey(FILE *) 
    692695     writes a PEM-encoded private key to the file handle 
    693696     throws an exception if no private key is loaded  
    694    void write_privkey(char *) 
     697f  void write_privkey(char *) 
    695698      writes a PEM-encoded private key a file named out 
    696699      throws an exception if no private key is loaded  
     
    707710            } 
    708711/*** 
    709    abac_chunk_t cert_chunk() 
     712f  abac_chunk_t cert_chunk() 
    710713     returns a DER-encoded binary representation of the X.509 ID cert 
    711714     associated with this ID. 
     
    715718            { return abac_id_cert_chunk(m_id); } 
    716719/*** 
    717    char *string() 
     720f  char *string() 
    718721     returns literal string of the id credential 
    719722***/ 
     
    733736ABAC::Attribute 
    734737   This is the attribute representation for the access policy rule 
    735           LHS <- RHS 
     738       LHS <- RHS 
    736739   The sequence of generation is to  
    737      first, instantiate the object, ie, LHS (head) 
    738      second, adding subject(s) to it, ie, RHS (tail) 
    739      and then baking it. 
     740       first, instantiate the object, ie, LHS (head) 
     741       second, adding subject(s) to it, ie, RHS (tail) 
     742       and then baking it. 
    740743   Only once it's baked can you access the X.509 cert.  
    741744   Once it's been baked you can no longer add subjects to it 
     
    744747        public: 
    745748/*** 
    746    Attribute() 
     749f  Attribute() 
    747750     default constructor, do not use, for swig only  
    748    Attribute(const Attribute &) 
     751f  Attribute(const Attribute &) 
    749752     copy constructor, used for cloning an attribute 
    750    ~Attribute() 
     753f  ~Attribute() 
    751754     default destructor 
    752755***/ 
     
    757760            { if(m_attr) abac_attribute_free(m_attr); } 
    758761/*** 
    759    Attribute(abac_attribute_t *) 
     762f  Attribute(abac_attribute_t *) 
    760763     constructor that takes abac_attribute_t, locally used 
    761    Attribute(abac_credential_t *) 
     764f  Attribute(abac_credential_t *) 
    762765     constructor that takes abac_credential_t, locally used  
    763766***/ 
     
    767770            { m_attr=abac_attribute_dup(abac_credential_attribute(cred)); } 
    768771/*** 
    769    Attribute(Role&, int) 
     772f  Attribute(Role&, int) 
    770773     constructor that creates an attribute policy to be signed by the issuer  
    771774     with the given role with a specified validity period  
     
    781784            } 
    782785/*** 
    783    Attribute(Oset&, int) 
     786f  Attribute(Oset&, int) 
    784787     constructor that creates an attribute policy to be signed by the issuer  
    785788     with the given oset with a specified validity period  
     
    795798            } 
    796799/*** 
    797    bool add_tail(Role&) 
     800f  bool add_tail(Role&) 
    798801      Add a role tail.  Call multiple times for intersections 
    799    bool add_tail(Oset&) 
     802f  bool add_tail(Oset&) 
    800803      Add an oset tail.  Call multiple times for intersections 
    801804***/ 
     
    811814            } 
    812815/*** 
    813    char *head_string() 
     816f  char *head_string() 
    814817     returns literal string of head of the attribute 
    815    char *tail_string() 
     818f  char *tail_string() 
    816819     returns literal string of tail of the attribute 
    817820***/ 
     
    827830            } 
    828831/*** 
    829    char *head_typed_string() 
     832f  char *head_typed_string() 
    830833     returns typed literal string of head of the attribute 
    831    char *tail_typed_string() 
     834f  char *tail_typed_string() 
    832835     returns typed literal string of tail of the attribute 
    833836***/ 
     
    843846            } 
    844847/*** 
    845    char *string() 
     848f  char *string() 
    846849     returns literal string of the attribute 
    847    char *typed_string() 
     850f  char *typed_string() 
    848851     returns typed literal string of the attribute 
    849852***/ 
     
    867870            } 
    868871/*** ??? not sure about implmentation 
    869    const Role &role_head() 
     872f  const Role &role_head() 
    870873     returns the head role 
    871    const Oset &oset_head() 
     874f  const Oset &oset_head() 
    872875     returns the oset head 
    873876***/ 
     
    883886            } 
    884887/*** ??? 
    885    std::vector<Role> role_tails(bool &) 
     888f  std::vector<Role> role_tails(bool &) 
    886889     retrieve tail role which maybe more than 1 if intersecting 
    887    std::vector<Oset> oset_tails(bool &) 
     890f  std::vector<Oset> oset_tails(bool &) 
    888891     retrieve tail oset which maybe more than 1 if intersecting 
    889892***/ 
     
    923926            } 
    924927/*** 
    925    abac_attribute_t *attribute() 
     928f  abac_attribute_t *attribute() 
    926929      return libabac structure for attribute 
    927930***/ 
     
    929932 
    930933/*** 
    931    bool bake() 
     934f  bool bake() 
    932935     Generate the cert. Call this after you've added subjects to your cert. 
    933936     This returns false if there are no subjects 
     
    943946            } 
    944947/*** 
    945    bool baked() 
     948f  bool baked() 
    946949     returns true iff the cert has been baked. 
    947950***/ 
     
    950953 
    951954/*** 
    952    void write_cert(FILE *) 
     955f  void write_cert(FILE *) 
    953956     write the DER-encoded X.509 attribute cert to the open file handle 
    954957     Throws an exception if the cert isn't baked  
     
    960963            } 
    961964/*** 
    962    void write_cert(char *) 
     965f  void write_cert(char *) 
    963966     write the DER-encoded X.509 attribute cert to a file named out 
    964967     Throws an exception if the cert isn't baked  
     
    970973            } 
    971974/*** 
    972    abac_chunk_t cert_chunk() 
     975f  abac_chunk_t cert_chunk() 
    973976     returns a DER-encoded binary representation of the X.509 attribute 
    974977     cert associated with this cert 
     
    980983 
    981984/*** 
    982    int consume() 
     985f  int consume() 
    983986     generate yap clauses and injected into db  
    984987***/ 
     
    996999/***  
    9971000ABAC::Context 
    998    An ABAC Context  
     1001    An ABAC Context  
    9991002***/ 
    10001003    class Context { 
    10011004        public: 
    10021005/*** 
    1003    Context() 
     1006f  Context() 
    10041007     default constructor 
    1005    Context(const Context &) 
     1008f  Context(const Context &) 
    10061009     copy constructor, used for cloning the context 
    1007    ~Context() 
     1010f  ~Context() 
    10081011     default destructor 
    10091012***/ 
     
    10181021            } 
    10191022/*** 
    1020    void dump_yap() 
     1023f  void dump_yap() 
    10211024     dump the complete yap prolog database 
    10221025***/ 
     
    10251028 
    10261029/*** 
    1027    int load_id(ABAC::ID&) 
     1030f  int load_id(ABAC::ID&) 
    10281031     load id cert from ID  
    1029    int load_id_file(char *) 
     1032f  int load_id_file(char *) 
    10301033     load id cert from an idkey combo file. key retrieval will be attempt 
    10311034     but won't fail if not found 
    1032    int load_id_file(char *, char *)  
     1035f  int load_id_file(char *, char *)  
    10331036     load id cert from an id file and a key file 
    1034    int load_id_chunk(abac_chunk_t)  
     1037f  int load_id_chunk(abac_chunk_t)  
    10351038     load id cert from a chunk structure 
    1036    returns: 
     1039     returns: 
    10371040       ABAC_CERT_SUCCESS   successfully loaded 
    10381041       ABAC_CERT_INVALID   invalid certificate (or file not found) 
     
    10491052 
    10501053/*** 
    1051    int load_attribute(ABAC::Attribute&) 
     1054f  int load_attribute(ABAC::Attribute&) 
    10521055     load attribute credential from attribute structure 
    1053    int load_attribute_file(char *) 
     1056f  int load_attribute_file(char *) 
    10541057     load attribute credential from a file 
    1055    int load_attribute_chunk(abac_chunk_t) 
     1058f  int load_attribute_chunk(abac_chunk_t) 
    10561059     load attribute credential from a chunk 
    1057    returns the same values as above, additionally 
    1058    returns ABAC_CERT_MISSING_ISSUER if the issuer 
    1059    certificate has not been loaded  
     1060f    returns the same values as above, additionally 
     1061     returns ABAC_CERT_MISSING_ISSUER if the issuer 
     1062     certificate has not been loaded  
    10601063***/ 
    10611064            int load_attribute(ABAC::Attribute& a) 
     
    10671070 
    10681071/*** 
    1069    void load_directory(char *) 
     1072f  void load_directory(char *) 
    10701073     load a directory full of certificates: 
    1071         first: ${path}/*_ID.{der,pem} as identity certificates 
     1074f       first: ${path}/*_ID.{der,pem} as identity certificates 
    10721075               implicitly looking for ${path}/*_private.{der,pem} as 
    10731076               the private key file 
     
    10781081            { abac_context_load_directory(m_ctx, path); } 
    10791082/***  
    1080    std::vector<Attribute> query(char *, char *, bool &) 
     1083f  std::vector<Attribute> query(char *, char *, bool &) 
    10811084     the string version is for query that is composed by hand with SHA or 
    10821085     in non ABAC_CN mode   
    1083    std::vector<Attribute> query(Role &, Role &, bool &) 
     1086f  std::vector<Attribute> query(Role &, Role &, bool &) 
    10841087   std::vector<Attribute> query(Oset &, Oset &, bool &) 
    1085  
    10861088     runs the query: 
    10871089       role <-?- principal 
     1090       oset <-?- principal/obj 
    10881091     returns true/false in success 
    1089      returns a proof upon success, partial proof on failure  
     1092     returns a proof upon success,  
     1093     partial proof on failure (not implemented yet)  
    10901094***/ 
    10911095            std::vector<Attribute> query(char *role, char *principal, bool &success) { 
     
    11461150 
    11471151/*** 
    1148    std::vector<Attribute> context_credentials(bool &) 
     1152f  std::vector<Attribute> context_credentials(bool &) 
    11491153     returns a vector of all the credentials loaded in the context 
    11501154     extracted from the internal data structure 
     
    11691173 
    11701174/*** 
    1171    std::vector<Attribute> context_principals(bool &) 
     1175f  std::vector<Attribute> context_principals(bool &) 
    11721176     returns a vector of all the principals loaded in the context 
    11731177     extracted from the internal data structure 
     
    11901194            } 
    11911195/*** 
    1192    char *version() 
     1196f  char *version() 
    11931197     return the version of this interface 
    11941198***/ 
Note: See TracChangeset for help on using the changeset viewer.