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
|
# File 'lib/thales/pse/hsm.rb', line 31
def init_hsm(*args,&block)
expect = [
{ matcher: "enter new Admin SO pin:", block_key: :admin_so_pin, timeout: 5 },
{ matcher: "confirm new Admin SO pin:", block_key: :admin_so_pin_confirm, timeout: 5 },
{ matcher: "enter new Administrator\'s pin:", block_key: :admin_pin, timeout: 5 },
{ matcher: "confirm new Administrator\'s pin:", block_key: :admin_pin_confirm, timeout: 5 }
]
begin
cli_exec("ctconf") do |ops|
case ops
when :expect_list
expect
else
block.call(ops)
end
end
rescue ExecutableNotFoundError
raise Error, "Executable 'ctconf' not found from PATH. Please install the driver or add the executable to PATH"
end
end
|