private function deriveKeys(string $cipher, string $keySalt) : DerivedKeys
    {
        // Extract the number of bytes from the cipher
        $keyByteLength = $this->getKeyByteLengthForCipher($cipher);

        if ($this->secret->getType() === SecretTypes::KEY) {
            return $this->keyDeriver->deriveKeysFromKey($this->secret->getValue(), $keySalt, $keyByteLength);
        } else {
            return $this->keyDeriver->deriveKeysFromPassword($this->secret->getValue(), $keySalt, $keyByteLength);
        }
    }
private function deriveKeys(string $cipher, string $keySalt) : DerivedKeys
    {
        // Extract the number of bytes from the cipher
        $keyByteLength = $this->getKeyByteLengthForCipher($cipher);

        if ($this->secret->getType() === SecretTypes::KEY) {
            return $this->keyDeriver->deriveKeysFromKey($this->secret->getValue(), $keySalt, $keyByteLength);
        } else {
            return $this->keyDeriver->deriveKeysFromPassword($this->secret->getValue(), $keySalt, $keyByteLength);
        }
    }
private function deriveKeys ( string $ cipher , string $ keySalt ) : DerivedKeys { // Extract the number of bytes from the cipher $ keyByteLength = $ this -> getKeyByteLengthForCipher ( $ cipher ) ; if ( $ this -> secret -> getType ( ) === SecretTypes :: KEY ) { return $ this -> keyDeriver -> deriveKeysFromKey ( $ this -> secret -> getValue ( ) , $ keySalt , $ keyByteLength ) ; } else { return $ this -> keyDeriver -> deriveKeysFromPassword ( $ this -> secret -> getValue ( ) , $ keySalt , $ keyByteLength ) ; } }
Derives keys that are suitable for encryption and decryption

@param string $cipher The cipher used
@param string $keySalt The salt to use on the keys
@return DerivedKeys The derived keys
Derives keys that are suitable for encryption and decryption