I have a TextInput Area inside pasted some example ssh key to validate whether it is valid or not. Is there any npm package or regular expression? Example SSH key
<TextArea
id={'public-key'}
labelText={_getPublicKeyLabel()}
required
aria-required="true"
invalid={sshKeyInput.keyTouched && !_isPublicKeyValid()}
invalidText={sshKeyInput.key.length > 0 ? 'please provide valid ssh key' : t('dashboard.ssh_key_modal.public_key_required')}
rows={6}
light
onChange={(ev) =>
setSshKeyInput({
...sshKeyInput,
key: ev.target.value,
keyTouched: true,
})
}
/>
Exxample ssh-rsa AAAAB3NXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
If I enter this ssh key into text area how can we check whether it is valid or not. Please share me your thoughts or ideas