signPayload method

Future<SignPayloadResponse> signPayload({
  1. required Uint8List payload,
  2. required String payloadFormat,
  3. required String profileName,
  4. String? profileOwner,
})

Signs a binary payload and returns a signature envelope.

May throw AccessDeniedException. May throw InternalServiceErrorException. May throw ResourceNotFoundException. May throw TooManyRequestsException. May throw ValidationException.

Parameter payload : Specifies the object digest (hash) to sign.

Parameter payloadFormat : Payload content type. The single valid type is application/vnd.cncf.notary.payload.v1+json.

Parameter profileName : The name of the signing profile.

Parameter profileOwner : The AWS account ID of the profile owner.

Implementation

Future<SignPayloadResponse> signPayload({
  required Uint8List payload,
  required String payloadFormat,
  required String profileName,
  String? profileOwner,
}) async {
  final $payload = <String, dynamic>{
    'payload': base64Encode(payload),
    'payloadFormat': payloadFormat,
    'profileName': profileName,
    if (profileOwner != null) 'profileOwner': profileOwner,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/signing-jobs/with-payload',
    exceptionFnMap: _exceptionFns,
  );
  return SignPayloadResponse.fromJson(response);
}