pub fn keygen(
    _gk: &Aw11GlobalKey,
    _msk: &Aw11MasterKey,
    _name: &String,
    _attributes: &Vec<String>,
) -> Option<Aw11SecretKey> {
    // if no attibutes or no gid
    if _attributes.is_empty() || _name.is_empty() {
        return None;
    }
    let mut _sk: Aw11SecretKey = Aw11SecretKey {
        _gid: _name.clone(),
        _attr: Vec::new(),
    };
    for _attribute in _attributes {
        add_attribute(_gk, _msk, _attribute, &mut _sk);
    }
    return Some(_sk);
}
/// Sets up and generates a new User by creating a secret user key (SK). The key is created for a user with a given "name" on the given set of attributes.
///
/// # Arguments
///
///	* `_gk` - A Global Parameters Key (GK), generated by setup()
///	* `_msk` - A Master Key (MK), associated with an authority and generated by authgen()
///	* `_name` - The name of the user the key is associated with. Must be unique.
///	* `_attributes` - A Vector of String attributes assigned to this User
///
/// # Remarks
///
/// In this scheme, all attributes are converted to upper case bevor calculation, i.e. they are case insensitive
/// This means that all attributes "tEsT", "TEST" and "test" are treated the same in this scheme.
Sets up and generates a new User by creating a secret user key (SK). The key is created for a user with a given "name" on the given set of attributes.
Sets up and generates a new User by creating a secret user key ( SK ) . The key is created for a user with a given " name " on the given set of attributes .
pub fn keygen(
    _gk: &Aw11GlobalKey,
    _msk: &Aw11MasterKey,
    _name: &String,
    _attributes: &Vec<String>,
) -> Option<Aw11SecretKey> {
    // if no attibutes or no gid
    if _attributes.is_empty() || _name.is_empty() {
        return None;
    }
    let mut _sk: Aw11SecretKey = Aw11SecretKey {
        _gid: _name.clone(),
        _attr: Vec::new(),
    };
    for _attribute in _attributes {
        add_attribute(_gk, _msk, _attribute, &mut _sk);
    }
    return Some(_sk);
}
pub fn keygen ( _gk : & Aw11GlobalKey , _msk : & Aw11MasterKey , _name : & String , _attributes : & Vec < String > , ) -> Option < Aw11SecretKey > { // if no attibutes or no gid if _attributes . is_empty ( ) || _name . is_empty ( ) { return None ; } let mut _sk : Aw11SecretKey = Aw11SecretKey { _gid : _name . clone ( ) , _attr : Vec :: new ( ) , } ; for _attribute in _attributes { add_attribute ( _gk , _msk , _attribute , & mut _sk ) ; } return Some ( _sk ) ; }
Sets up and generates a new User by creating a secret user key (SK).
Sets up and generates a new User by creating a secret user key ( SK ) .
_gk
&Aw11GlobalKey
_msk
&Aw11MasterKey
_name
&String
_attributes
&Vec<String>
_gk
&Aw11GlobalKey
_msk
&Aw11MasterKey
_name
&String
_attributes
&Vec<String>
remarks
In this scheme, all attributes are converted to upper case bevor calculation, i.e. they are case insensitive
This means that all attributes "tEsT", "TEST" and "test" are treated the same in this scheme.
In this scheme all attributes are converted to upper case bevor calculation i . e . they are case insensitive This means that all attributes " tEsT " " TEST " and " test " are treated the same in this scheme .