public function setPins(array $keys)
    {
        $envKeys = array();

        foreach ($keys as $keyId => $key) {
            $envKeys[$keyId] = is_array($key) ? $key['passphrase'] : $key;
        }

        $_ENV['PINENTRY_USER_DATA'] = json_encode($envKeys);
    }
public function setPins(array $keys)
    {
        $envKeys = array();

        foreach ($keys as $keyId => $key) {
            $envKeys[$keyId] = is_array($key) ? $key['passphrase'] : $key;
        }

        $_ENV['PINENTRY_USER_DATA'] = json_encode($envKeys);
    }
public function setPins ( array $ keys ) { $ envKeys = array ( ) ; foreach ( $ keys as $ keyId => $ key ) { $ envKeys [ $ keyId ] = is_array ( $ key ) ? $ key [ 'passphrase' ] : $ key ; } $ _ENV [ 'PINENTRY_USER_DATA' ] = json_encode ( $ envKeys ) ; }
Sets the PINENTRY_USER_DATA environment variable with the currently
added keys and passphrases

Keys and passphrases are stored as an indexed array of passphrases
in JSON encoded to a flat string.

For GnuPG 2.x this is how passphrases are passed. For GnuPG 1.x the
environment variable is set but not used.

@param array $keys the internal key array to use.

@return void
Sets the PINENTRY_USER_DATA environment variable with the currently added keys and passphrases