Class: PkiExpress::TimestampAuthority
- Inherits:
-
Object
- Object
- PkiExpress::TimestampAuthority
- Defined in:
- lib/pki_express/timestamp_authority.rb
Instance Attribute Summary collapse
-
#auth_type ⇒ Object
readonly
Returns the value of attribute auth_type.
-
#basic_auth ⇒ Object
readonly
Returns the value of attribute basic_auth.
-
#ssl_thumbprint ⇒ Object
readonly
Returns the value of attribute ssl_thumbprint.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #get_cmd_arguments ⇒ Object
-
#initialize(url) ⇒ TimestampAuthority
constructor
A new instance of TimestampAuthority.
- #set_basic_authentication(username, password) ⇒ Object
- #set_oauth_token_authentication(token) ⇒ Object
- #set_ssl_thumbprint(ssl_thumbprint) ⇒ Object
Constructor Details
#initialize(url) ⇒ TimestampAuthority
Returns a new instance of TimestampAuthority.
5 6 7 8 9 10 11 |
# File 'lib/pki_express/timestamp_authority.rb', line 5 def initialize(url) @url = url @auth_type = TsaAuthenticationType::NONE @token = nil @ssl_thumbprint = nil @basic_auth = nil end |
Instance Attribute Details
#auth_type ⇒ Object (readonly)
Returns the value of attribute auth_type.
3 4 5 |
# File 'lib/pki_express/timestamp_authority.rb', line 3 def auth_type @auth_type end |
#basic_auth ⇒ Object (readonly)
Returns the value of attribute basic_auth.
3 4 5 |
# File 'lib/pki_express/timestamp_authority.rb', line 3 def basic_auth @basic_auth end |
#ssl_thumbprint ⇒ Object (readonly)
Returns the value of attribute ssl_thumbprint.
3 4 5 |
# File 'lib/pki_express/timestamp_authority.rb', line 3 def ssl_thumbprint @ssl_thumbprint end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
3 4 5 |
# File 'lib/pki_express/timestamp_authority.rb', line 3 def token @token end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/pki_express/timestamp_authority.rb', line 3 def url @url end |
Instance Method Details
#get_cmd_arguments ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/pki_express/timestamp_authority.rb', line 28 def get_cmd_arguments args = [] args.append('--tsa-url') args.append(url) case auth_type when TsaAuthenticationType::NONE when TsaAuthenticationType::BASIC_AUTH args.append('--tsa-basic-auth') args.append(@basic_auth) when TsaAuthenticationType::SSL args.append('--tsa-ssl-thumbprint') args.append(@ssl_thumbprint) when TsaAuthenticationType::OAUTH_TOKEN args.append('--tsa-token') args.append(token) else raise 'Unknown authentication type of the timestamp authority' end args end |
#set_basic_authentication(username, password) ⇒ Object
18 19 20 21 |
# File 'lib/pki_express/timestamp_authority.rb', line 18 def set_basic_authentication(username, password) @basic_auth = "#{username}:#{password}" @auth_type = TsaAuthenticationType::BASIC_AUTH end |
#set_oauth_token_authentication(token) ⇒ Object
13 14 15 16 |
# File 'lib/pki_express/timestamp_authority.rb', line 13 def set_oauth_token_authentication(token) @token = token @auth_type = TsaAuthenticationType::OAUTH_TOKEN end |
#set_ssl_thumbprint(ssl_thumbprint) ⇒ Object
23 24 25 26 |
# File 'lib/pki_express/timestamp_authority.rb', line 23 def set_ssl_thumbprint(ssl_thumbprint) @ssl_thumbprint = ssl_thumbprint @auth_type = TsaAuthenticationType::SSL end |