class RestPki::Authentication
Attributes
ignore_revocation_status_unknown[RW]
Public Class Methods
new(restpki_client)
click to toggle source
# File lib/rest_pki/authentication.rb, line 9 def initialize(restpki_client) @restpki_client = restpki_client @certificate_info = nil @done = false @ignore_revocation_status_unknown = false end
Public Instance Methods
certificate_info()
click to toggle source
# File lib/rest_pki/authentication.rb, line 36 def certificate_info unless @done raise 'The field "certificate_info" can only be accessed after calling the complete_with_webpki method' end @certificate_info end
complete_with_webpki(token)
click to toggle source
# File lib/rest_pki/authentication.rb, line 25 def complete_with_webpki(token) response = @restpki_client.post("Api/Authentications/#{token}/Finalize", nil, 'authentication_model') unless response['certificate'].nil? @certificate_info = response['certificate'] end @done = true ValidationResults.new(response['validationResults']) end
start_with_webpki(security_context_id)
click to toggle source
# File lib/rest_pki/authentication.rb, line 16 def start_with_webpki(security_context_id) request = { securityContextId: security_context_id, ignoreRevocationStatusUnknown: @ignore_revocation_status_unknown } response = @restpki_client.post('Api/Authentications', request, 'authentication_model') response['token'] end