protected function validateKeyCredential()
    {
        if (!$this->isPosted('save')) {
            return false;
        }

        $this->setSubmitted('credential');
        $this->validateElement(array('name' => $this->text('Name')), 'length', array(1, 255));
        $this->validateElement(array('data.key' => $this->text('Key')), 'length', array(1, 255));

        return !$this->hasErrors();
    }