Skip to content

Commit

Permalink
Merge pull request #8 from PrisisForks/v2.x
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 c0316fa + b745e39 commit 1f0d4c0
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 @@ -16,6 +16,7 @@ class PasswordLock
* @param Key $aesKey
* @return string
* @throws \Exception
* @throws \InvalidArgumentException
*/
public static function hashAndEncrypt($password, Key $aesKey)
{
Expand Down Expand Up @@ -102,10 +103,10 @@ public static function decryptAndVerify($password, $ciphertext, Key $aesKey)
$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 @@ -116,10 +117,10 @@ public static function rotateKey($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 1f0d4c0

Please sign in to comment.