curveCoordinateLength static method

int curveCoordinateLength(
  1. String namedCurve
)

Implementation

static int curveCoordinateLength(String namedCurve) {
  switch (namedCurve.toUpperCase()) {
    case 'P-256':
    case 'SECP256R1':
    case 'BRAINPOOLP256R1':
      return 32;
    case 'P-384':
    case 'SECP384R1':
      return 48;
    case 'P-521':
    case 'SECP521R1':
    case 'BRAINPOOLP512R1':
      return 66;
    default:
      throw UnsupportedError('Curva ECDSA não suportada: $namedCurve');
  }
}