validateCsr function

void validateCsr(
  1. Map<String, dynamic>? encryptedCSR
)

Valida CSR: debe existir y tener 'csr' string no vacĂ­o.

Implementation

void validateCsr(Map<String, dynamic>? encryptedCSR) {
  if (encryptedCSR == null ||
      encryptedCSR['csr'] is! String ||
      (encryptedCSR['csr'] as String).trim().isEmpty) {
    throw ApacuanaAPIError(
      'The "encryptedCSR" parameter is required and must be an object '
      'with a non-empty "csr" string property.',
      statusCode: 400,
      errorCode: 'INVALID_PARAMETER_FORMAT',
    );
  }
}