Skip to content

Commit

Permalink
Merge pull request #9 from PrisisForks/master
Browse files Browse the repository at this point in the history
Added doc for \InvalidArgumentException on hashAndEncrypt
  • Loading branch information
paragonie-scott committed May 20, 2016
2 parents 02f2a5b + b08248c commit 72af380
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/PasswordLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class PasswordLock
* @param Key $aesKey
* @return string
* @throws \Exception
* @throws \InvalidArgumentException
*/
public static function hashAndEncrypt(string $password, Key $aesKey): string
{
Expand Down Expand Up @@ -103,10 +104,10 @@ public static function decryptAndVerify(string $password, string $ciphertext, Ke
$hash
);
}

/**
* Key rotation method -- decrypt with your old key then re-encrypt with your new key
*
*
* @param string $ciphertext
* @param Key $oldKey
* @param Key $newKey
Expand All @@ -117,10 +118,10 @@ public static function rotateKey(string $ciphertext, Key $oldKey, Key $newKey):
$plaintext = Crypto::decrypt($ciphertext, $oldKey);
return Crypto::encrypt($plaintext, $newKey);
}

/**
* For migrating from an older version of the library
*
*
* @param string $password
* @param string $ciphertext
* @param string $oldKey
Expand Down

0 comments on commit 72af380

Please sign in to comment.