JsonWebKey.ec constructor

JsonWebKey.ec({
  1. required String curve,
  2. BigInt? xCoordinate,
  3. BigInt? yCoordinate,
  4. BigInt? privateKey,
  5. String? keyId,
  6. String? algorithm,
})

Creates a JsonWebKey of type EC

Implementation

JsonWebKey.ec(
    {required String curve,
    BigInt? xCoordinate,
    BigInt? yCoordinate,
    BigInt? privateKey,
    String? keyId,
    String? algorithm})
    : this.fromJson({
        'kty': 'EC',
        'crv': curve,
        if (xCoordinate != null) 'x': _intToBase64(xCoordinate),
        if (yCoordinate != null) 'y': _intToBase64(yCoordinate),
        if (privateKey != null) 'd': _intToBase64(privateKey),
        if (keyId != null) 'kid': keyId,
        if (algorithm != null) 'alg': algorithm
      });