diff --git a/doc/Classes/Asymmetric/Crypto.md b/doc/Classes/Asymmetric/Crypto.md index d320028..5398e84 100644 --- a/doc/Classes/Asymmetric/Crypto.md +++ b/doc/Classes/Asymmetric/Crypto.md @@ -84,3 +84,15 @@ Calculates a digital signature of `$message`, using [`sodium_crypto_sign()`](htt > `public` verify(`string $message`, [`SignaturePublicKey`](SignaturePublicKey.md) `$secretKey`, `string $signature`, `$encoding = Halite::ENCODE_BASE64URLSAFE`) : `boolean` Does the signature match the contents of the message, for the given public key? + +### `signAndEncrypt()` + +> `public` signAndEncrypt(`HiddenString $message`, [`SignatureSecretKey`](SignatureSecretKey.md) `$secretKey`, [`PublicKey`](PublicKey.md) `$recipientPublicKey`, `$encoding = Halite::ENCODE_BASE64URLSAFE`) : `string` + +Signs and encrypts a message. Note that a `SignaturePublicKey` or `EncryptionPublicKey` +is acceptable for the third argument. This is intended to facilitate the GPG use-case. + +> `public` verifyAndDecrypt(`string $message`, [`SignaturePublicKey`](SignaturePublicKey.md) `$secretKey`, [`SecretKey`](SecretKey.md) `$mySecretKey`, `$encoding = Halite::ENCODE_BASE64URLSAFE`) : `HiddenString` + +Decrypts and verifies a message. Note that a `SignatureSecretKey` or `EncryptionSecretKey` +is acceptable for the third argument. This is intended to facilitate the GPG use-case. diff --git a/doc/Classes/Util.md b/doc/Classes/Util.md index 94d5e46..0aa7647 100644 --- a/doc/Classes/Util.md +++ b/doc/Classes/Util.md @@ -51,20 +51,6 @@ Returns a copy of a string without triggering PHP's optimizations. The string returned by this method can safely be used with `sodium_memzero()` without corrupting other copies of the same string. -### `safeStrlen()` - -> `public static` safeStrlen(`string $str`): `int` - -Designed to withstand `mbstring.func_overload`, this function will always return -the number of bytes in a string rather than UTF-8 characters. - -### `safeSubstr()` - -> `public static` safeSubstr(`string $str`, `int $start`, `int $length = null`): `string` - -Get a substring of raw binary data (immune to being broken by -`mbstring.func_overload`). - ### `xorStrings()` > `public static` xorStrings(`string $left`, `string $right`): `string`