policy method Null safety

Future<L0StorageModelPolicyRsp> policy()

Request a new L0StorageModelPolicyRsp.

If there is any HTTP response other than 200 the response is thrown as an HttpException. Other http client exceptions such as SocketException and FormatException are propagated.

Implementation

Future<L0StorageModelPolicyRsp> policy() async {
  String stringToSign = const Uuid().v4();
  Uint8List signature = UtilsRsa.sign(
      _privateKey, Uint8List.fromList(utf8.encode(stringToSign)));
  return await _repository.policy(L0StorageModelPolicyReq(
      pubKey: _privateKey.public.encode(),
      signature: base64Encode(signature),
      stringToSign: stringToSign));
}