protected function _checkCipherKeySize(CipherAlgorithmIdentifier $algo,
        string $key)
    {
        if ($algo instanceof BlockCipherAlgorithmIdentifier) {
            if (strlen($key) != $algo->keySize()) {
                throw new \UnexpectedValueException(
                    sprintf('Key length for %s must be %d, %d given.',
                        $algo->name(), $algo->keySize(), strlen($key)));
            }
        }
    }
protected function _checkCipherKeySize(CipherAlgorithmIdentifier $algo,
        string $key)
    {
        if ($algo instanceof BlockCipherAlgorithmIdentifier) {
            if (strlen($key) != $algo->keySize()) {
                throw new \UnexpectedValueException(
                    sprintf('Key length for %s must be %d, %d given.',
                        $algo->name(), $algo->keySize(), strlen($key)));
            }
        }
    }
protected function _checkCipherKeySize ( CipherAlgorithmIdentifier $ algo , string $ key ) { if ( $ algo instanceof BlockCipherAlgorithmIdentifier ) { if ( strlen ( $ key ) != $ algo -> keySize ( ) ) { throw new \ UnexpectedValueException ( sprintf ( 'Key length for %s must be %d, %d given.' , $ algo -> name ( ) , $ algo -> keySize ( ) , strlen ( $ key ) ) ) ; } } }
Validate cipher algorithm key size.

@param CipherAlgorithmIdentifier $algo
@param string $key
@throws \UnexpectedValueException
Validate cipher algorithm key size .