rsa static method

JsonWebKey rsa({
  1. required BigInt modulus,
  2. BigInt? exponent,
  3. BigInt? privateExponent,
  4. BigInt? firstPrimeFactor,
  5. BigInt? secondPrimeFactor,
  6. String? keyId,
  7. String? algorithm,
})

Creates a JsonWebKey of type RSA

Implementation

static JsonWebKey rsa({
  required BigInt modulus,
  BigInt? exponent,
  BigInt? privateExponent,
  BigInt? firstPrimeFactor,
  BigInt? secondPrimeFactor,
  String? keyId,
  String? algorithm,
}) =>
    JsonWebKey.fromJson({
      'kty': 'RSA',
      'n': _intToBase64(modulus),
      if (exponent != null) 'e': _intToBase64(exponent),
      if (privateExponent != null) 'd': _intToBase64(privateExponent),
      if (firstPrimeFactor != null) 'p': _intToBase64(firstPrimeFactor),
      if (secondPrimeFactor != null) 'q': _intToBase64(secondPrimeFactor),
      if (keyId != null) 'kid': keyId,
      if (algorithm != null) 'alg': algorithm
    })!;