Safer validation of signed strings