Class: Wx::SecretValue

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/doc/gen/secret_store.rb,
lib/wx/doc/secret_store.rb

Overview

Note:

Due to a bug using binary secrets will not work for WXGTK wxWidgets<=3.2.4 (WXOSX and WXMSW work fine). This has been fixed for later versions.

Note:

This class is untracked and should not be derived from nor instances extended!

Represents the value of a secret in SecretStore.

Immutable value-like class which tries to ensure that the secret value will be removed once it’s not needed any more.

Category: Miscellaneous

Requires:

  • USE_SECRETSTORE

Instance Method Summary collapse

Constructor Details

#initializeWx::SecretValue #initialize(secret) ⇒ Wx::SecretValue #initialize(other) ⇒ Wx::SecretValue

Returns a new instance of SecretValue.

Overloads:

  • #initializeWx::SecretValue

    Creates an empty secret value (not the same as an empty password).

  • #initialize(secret) ⇒ Wx::SecretValue

    Creates a secret value from the given string. The secret argument may contain NUL bytes. Any UTF-8 encoded (or encodable; wxRuby will attempt re-encoding as UTF-8 for any string not encoded UTF-8 or ASCII-8BIT) string will be stored as UTF-8 encoded string. In these cases use #get_as_string if needing to compare the original string to a restored string. Otherwise the string will be stored as ASCII-8BIT encoded string. In these cases use #get_data if needing to compare the original string to a restored string. See #== for comparing secret values opaquely.

    Parameters:

    • secret (String)
  • #initialize(other) ⇒ Wx::SecretValue

    Creates a copy of an existing secret.

    Parameters:



38
# File 'lib/wx/doc/secret_store.rb', line 38

def initialize(*args) end

Instance Method Details

#==(other) ⇒ Boolean

Compare with another secret for equality.

Parameters:

Returns:

  • (Boolean)


111
# File 'lib/wx/doc/gen/secret_store.rb', line 111

def ==(other) end

#get_as_stringString

Returns a copy of the secret data as an UTF-8 encoded String. Make sure to use this method only if sure that the secret originally stored was indeed UTF-8 data as otherwise the returned string will not match the stored data. For more security Wx::SecretStore.wipe should be used to wipe the secret data after use.

Returns:

  • (String)

    secret data



51
# File 'lib/wx/doc/secret_store.rb', line 51

def get_as_string; end

#get_dataString

Returns a copy of the secret data as an ASCII-8BIT encoded String. Be aware this could be binary data and may contain embedded NUL characters. For more security Wx::SecretStore.wipe should be used to wipe the secret data after use.

Returns:

  • (String)

    secret data



44
# File 'lib/wx/doc/secret_store.rb', line 44

def get_data; end

#is_okBoolean Also known as: ok?

Check if a secret is not empty.

Returns:

  • (Boolean)


105
# File 'lib/wx/doc/gen/secret_store.rb', line 105

def is_ok; end