__construct()
__construct()
Throws an exception if you try to instantiate it
Throws
- \Alphred\UseOnlyAsStatic
if you try to institate a Globals object
Enables easy access to parts of the Keychain for secure password storage / retrieval
Uses the security
command in order to add / retrieve / delete passwords. Note: we use
only the "generic" password functions and not the "internet" password functions.
save_password(string $account, string $password, boolean $update = true, string $service = null) : boolean
Saves a password to the keychain
string | $account | the name of the account |
string | $password | the new password |
boolean | $update | whether or not to update an old password (defaults to |
string | $service | optional: defaults to the bundleid of the workflow (if set) |
(indirectly )when trying to add a password that already exists without specifying 'update'
whether or not it was successful (usually true)
find_password(string $account, string $service = null) : string
Retrieves a password from the keychain
string | $account | the name of an account |
string | $service | optional: defaults to the bundleid of the workflow (if set) |
on an empty account
the password
call_security(string $action, string $service, string $account, string $args) : string|boolean
Interfaces directly with the `security` command
string | $action | one of 'add-', 'delete-', or 'find-generic-password' |
string | $service | the "owner" of the action; usually the bundle id |
string | $account | the "account" of the password |
string | $args | extra arguments for the security command |
when trying to add a password that already exists without specifying 'update'
when trying to find a password that does not exist
when something weird happens
either a found password or true