return exists(publicKey) &&
typeof publicKey === 'string' &&
publicKey.startsWith('-----BEGIN PUBLIC KEY-----') &&
- publicKey.indexOf('-----END PUBLIC KEY-----') !== -1 &&
+ publicKey.includes('-----END PUBLIC KEY-----') &&
validator.isLength(publicKey, CONSTRAINTS_FIELDS.ACTORS.PUBLIC_KEY)
}
typeof privateKey === 'string' &&
privateKey.startsWith('-----BEGIN RSA PRIVATE KEY-----') &&
// Sometimes there is a \n at the end, so just assert the string contains the end mark
- privateKey.indexOf('-----END RSA PRIVATE KEY-----') !== -1 &&
+ privateKey.includes('-----END RSA PRIVATE KEY-----') &&
validator.isLength(privateKey, CONSTRAINTS_FIELDS.ACTORS.PRIVATE_KEY)
}