keyPairFromStorageMap static method

AsymmetricKeyPair<RSAPublicKey, RSAPrivateKey> keyPairFromStorageMap(
  1. Map<String, dynamic> storedKeyPair
)

Implementation

static AsymmetricKeyPair<RSAPublicKey, RSAPrivateKey> keyPairFromStorageMap(
  Map<String, dynamic> storedKeyPair,
) {
  final modulus = _decodeBigIntHex(storedKeyPair['modulus']);
  final publicExponent = _decodeBigIntHex(storedKeyPair['publicExponent']);
  final privateExponent = _decodeBigIntHex(storedKeyPair['privateExponent']);
  final p = _decodeBigIntHex(storedKeyPair['p']);
  final q = _decodeBigIntHex(storedKeyPair['q']);

  return AsymmetricKeyPair<RSAPublicKey, RSAPrivateKey>(
    RSAPublicKey(modulus, publicExponent),
    RSAPrivateKey(modulus, privateExponent, p, q),
  );
}