Class: HrrRbSsh::Authentication::Method::Publickey::Context
- Inherits:
-
Object
- Object
- HrrRbSsh::Authentication::Method::Publickey::Context
- Defined in:
- lib/hrr_rb_ssh/authentication/method/publickey/context.rb
Instance Attribute Summary collapse
-
#message_number ⇒ Object
readonly
Returns the value of attribute message_number.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#public_key_algorithm_name ⇒ Object
readonly
Returns the value of attribute public_key_algorithm_name.
-
#public_key_blob ⇒ Object
readonly
Returns the value of attribute public_key_blob.
-
#service_name ⇒ Object
readonly
Returns the value of attribute service_name.
-
#session_id ⇒ Object
readonly
Returns the value of attribute session_id.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
-
#with_signature ⇒ Object
readonly
Returns the value of attribute with_signature.
Instance Method Summary collapse
-
#initialize(username, algorithm, session_id, message) ⇒ Context
constructor
A new instance of Context.
- #verify(username, public_key_algorithm_name, public_key) ⇒ Object
- #verify_public_key(public_key_algorithm_name, public_key) ⇒ Object
- #verify_public_key_algorithm_name(public_key_algorithm_name) ⇒ Object
- #verify_signature ⇒ Object
- #verify_username(username) ⇒ Object
Constructor Details
#initialize(username, algorithm, session_id, message) ⇒ Context
Returns a new instance of Context.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/hrr_rb_ssh/authentication/method/publickey/context.rb', line 22 def initialize username, algorithm, session_id, @username = username @algorithm = algorithm @session_id = session_id = = [:'message number'] @service_name = [:'service name'] @method_name = [:'method name'] @with_signature = [:'with signature'] @public_key_algorithm_name = [:'public key algorithm name'] @public_key_blob = [:'public key blob'] @signature = [:'signature'] end |
Instance Attribute Details
#message_number ⇒ Object (readonly)
Returns the value of attribute message_number.
11 12 13 |
# File 'lib/hrr_rb_ssh/authentication/method/publickey/context.rb', line 11 def end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
11 12 13 |
# File 'lib/hrr_rb_ssh/authentication/method/publickey/context.rb', line 11 def method_name @method_name end |
#public_key_algorithm_name ⇒ Object (readonly)
Returns the value of attribute public_key_algorithm_name.
11 12 13 |
# File 'lib/hrr_rb_ssh/authentication/method/publickey/context.rb', line 11 def public_key_algorithm_name @public_key_algorithm_name end |
#public_key_blob ⇒ Object (readonly)
Returns the value of attribute public_key_blob.
11 12 13 |
# File 'lib/hrr_rb_ssh/authentication/method/publickey/context.rb', line 11 def public_key_blob @public_key_blob end |
#service_name ⇒ Object (readonly)
Returns the value of attribute service_name.
11 12 13 |
# File 'lib/hrr_rb_ssh/authentication/method/publickey/context.rb', line 11 def service_name @service_name end |
#session_id ⇒ Object (readonly)
Returns the value of attribute session_id.
11 12 13 |
# File 'lib/hrr_rb_ssh/authentication/method/publickey/context.rb', line 11 def session_id @session_id end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature.
11 12 13 |
# File 'lib/hrr_rb_ssh/authentication/method/publickey/context.rb', line 11 def signature @signature end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
11 12 13 |
# File 'lib/hrr_rb_ssh/authentication/method/publickey/context.rb', line 11 def username @username end |
#with_signature ⇒ Object (readonly)
Returns the value of attribute with_signature.
11 12 13 |
# File 'lib/hrr_rb_ssh/authentication/method/publickey/context.rb', line 11 def with_signature @with_signature end |
Instance Method Details
#verify(username, public_key_algorithm_name, public_key) ⇒ Object
37 38 39 40 41 42 |
# File 'lib/hrr_rb_ssh/authentication/method/publickey/context.rb', line 37 def verify username, public_key_algorithm_name, public_key verify_username(username) \ && verify_public_key_algorithm_name(public_key_algorithm_name) \ && verify_public_key(public_key_algorithm_name, public_key) \ && verify_signature end |
#verify_public_key(public_key_algorithm_name, public_key) ⇒ Object
52 53 54 |
# File 'lib/hrr_rb_ssh/authentication/method/publickey/context.rb', line 52 def verify_public_key public_key_algorithm_name, public_key @algorithm.verify_public_key(public_key_algorithm_name, public_key, @public_key_blob) end |
#verify_public_key_algorithm_name(public_key_algorithm_name) ⇒ Object
48 49 50 |
# File 'lib/hrr_rb_ssh/authentication/method/publickey/context.rb', line 48 def verify_public_key_algorithm_name public_key_algorithm_name public_key_algorithm_name == @public_key_algorithm_name end |
#verify_signature ⇒ Object
56 57 58 |
# File 'lib/hrr_rb_ssh/authentication/method/publickey/context.rb', line 56 def verify_signature @algorithm.verify_signature(@session_id, ) end |
#verify_username(username) ⇒ Object
44 45 46 |
# File 'lib/hrr_rb_ssh/authentication/method/publickey/context.rb', line 44 def verify_username username username == @username end |