assertValid method

void assertValid()

Implementation

void assertValid() {
  switch (keyType) {
    case KeyType.ellipticCurve:
      if (ellipticCurve == null) {
        throw MissingParameterExeception('crv');
      }
      if (x == null) {
        throw MissingParameterExeception('x');
      }
      if (y == null) {
        throw MissingParameterExeception('y');
      }
      break;
    case KeyType.rsa:
      if (n == null) {
        throw MissingParameterExeception('n');
      }
      if (e == null) {
        throw MissingParameterExeception('e');
      }
      break;
    case KeyType.octet:
      if (k == null) {
        throw MissingParameterExeception('k');
      }
  }
}