Module: VacmanController::LowLevel
- Defined in:
- ext/vacman_controller/main.c
Class Method Summary collapse
- .generate_password ⇒ Object
- .get_kernel_param ⇒ Object
- .get_token_property ⇒ Object
-
.import(filename, key) ⇒ Object
Imports a .DPX file containing token seeds and initialisation values.
-
.kernel_property_names ⇒ Object
Kernel methods.
-
.library_version ⇒ Object
Global methods.
- .set_kernel_param ⇒ Object
- .set_token_pin ⇒ Object
- .set_token_property ⇒ Object
-
.token_property_names ⇒ Object
Token methods.
- .verify_password ⇒ Object
Class Method Details
.generate_password ⇒ Object
.get_kernel_param ⇒ Object
.get_token_property ⇒ Object
.import(filename, key) ⇒ Object
Imports a .DPX file containing token seeds and initialisation values.
Pass the pre-shared key to validate it as the second argument. The key is not validated by the AAL2 library, if you pass a different key than the one that was used to create the DPX, you will get back tokens that generate different OTPs.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'ext/vacman_controller/dpx.c', line 21 VALUE vacman_dpx_import(VALUE module, VALUE filename, VALUE key) { TDPXHandle dpx_handle; aat_int16 appl_count; aat_ascii appl_names[13*8]; aat_int16 token_count; aat_int32 result = AAL2DPXInit(&dpx_handle, rb_string_value_cstr(&filename), rb_string_value_cstr(&key), &appl_count, appl_names, &token_count); if (result != 0) { vacman_library_error("AAL2DPXInit", result); return Qnil; } aat_ascii sw_out_serial_No[22+1]; aat_ascii sw_out_type[5+1]; aat_ascii sw_out_authmode[2+1]; TDigipassBlob dpdata; VALUE list = rb_ary_new(); while (1) { result = AAL2DPXGetToken(&dpx_handle, &g_KernelParms, appl_names, sw_out_serial_No, sw_out_type, sw_out_authmode, &dpdata); if (result < 0) { vacman_library_error("AAL2DPXGetToken", result); return Qnil; } if (result == 107) break; VALUE hash = rb_hash_new(); vacman_digipass_to_rbhash(&dpdata, hash); rb_ary_push(list, hash); } AAL2DPXClose(&dpx_handle); return list; } |
.kernel_property_names ⇒ Object
Kernel methods
.library_version ⇒ Object
Global methods
.set_kernel_param ⇒ Object
.set_token_pin ⇒ Object
.set_token_property ⇒ Object
.token_property_names ⇒ Object
Token methods