Class: Virgil::SDK::HighLevel::VirgilAppCredentials

Inherits:
Object
  • Object
show all
Defined in:
lib/virgil/sdk/high_level/virgil_app_credentials.rb

Overview

This class provides credentials for application authentication using AppID and AppKey retrieved from development deshboard.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_id:, app_key_data:, app_key_password:) ⇒ VirgilAppCredentials

Initializes a new instance of the Virgil::SDK::HighLevel::VirgilAppCredentials class



56
57
58
59
60
# File 'lib/virgil/sdk/high_level/virgil_app_credentials.rb', line 56

def initialize(app_id:, app_key_data:, app_key_password:)
  @app_id = app_id
  @app_key_data = app_key_data
  @app_key_password = app_key_password
end

Instance Attribute Details

#app_idString (readonly)

uniquely identifies your application in Virgil services, and it is also used to identify the Virgil Card/Public key generated in a pair with application key.

Returns:

  • (String)


45
46
47
# File 'lib/virgil/sdk/high_level/virgil_app_credentials.rb', line 45

def app_id
  @app_id
end

#app_key_dataVirgilBuffer (readonly)

Application Private key value wrapped by an instance of the Virgil::SDK::HighLevel::VirgilBuffer class.

Returns:



49
50
51
# File 'lib/virgil/sdk/high_level/virgil_app_credentials.rb', line 49

def app_key_data
  @app_key_data
end

#app_key_passwordString (readonly)

Application key password is used to protect the application key.

Returns:

  • (String)


53
54
55
# File 'lib/virgil/sdk/high_level/virgil_app_credentials.rb', line 53

def app_key_password
  @app_key_password
end

Instance Method Details

#app_key(crypto) ⇒ Keys::PrivateKey

Application key is representing a Private key that is used to perform creation and revocation of Virgil Cards (Public key) in Virgil services. Also the application key can be used for cryptographic operations to take part in application logic.

Returns:

  • (Keys::PrivateKey)


67
68
69
# File 'lib/virgil/sdk/high_level/virgil_app_credentials.rb', line 67

def app_key(crypto)
  crypto.import_private_key(app_key_data.bytes, app_key_password)
end