]> git.arvados.org - arvados-workbench2.git/blob - src/validators/is-rsa-key.tsx
15768: cleanup Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox@curii.com>
[arvados-workbench2.git] / src / validators / is-rsa-key.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5
6 const ERROR_MESSAGE = 'Public key is invalid';
7
8 export const isRsaKey = (value: any) => {
9     return value.match(/ssh-rsa AAAA[0-9A-Za-z+/]+[=]{0,3}(( [^@]+@[^@]+)|$)/i) ? undefined : ERROR_MESSAGE;
10 };