Airship\Engine\Security\HiddenString::getString PHP Méthode

getString() public méthode

Explicit invocation -- get the raw string value
public getString ( ) : string
Résultat string
    public function getString() : string
    {
        return CryptoUtil::safeStrcpy($this->internalStringValue);
    }

Usage Example

Exemple #1
0
 /**
  * Register a failed login attempt
  *
  * @param string $username
  * @param string $ip
  * @param int $numFailures
  * @param HiddenString|null $password
  * @return bool
  */
 public function registerLoginFailure(string $username, string $ip, int $numFailures = 0, HiddenString $password = null) : bool
 {
     $logAfter = $this->config['log-after'] ?? null;
     if (!\is_null($logAfter)) {
         $logAfter = (int) $logAfter;
     }
     $publicKey = (string) ($this->config['log-public-key'] ?? '');
     $this->db->beginTransaction();
     $inserts = ['action' => self::ACTION_LOGIN, 'occurred' => (new \DateTime())->format(\AIRSHIP_DATE_FORMAT), 'username' => $username, 'ipaddress' => $ip, 'subnet' => $this->getSubnet($ip)];
     if (\is_int($logAfter) && !empty($publicKey)) {
         if ($numFailures >= $logAfter) {
             // Encrypt the password guess with the admin's public key
             $inserts['sealed_password'] = Asymmetric::seal($password->getString(), $this->getLogPublicKey($publicKey));
         }
     }
     $this->db->insert('airship_failed_logins', $inserts);
     return $this->db->commit();
 }
All Usage Examples Of Airship\Engine\Security\HiddenString::getString