Skip to content

sign_payload

sign_payload(
    profile_name: ProfileName,
    payload: Payload,
    payload_format: String,
    *,
    config_overrides: Optional[signerClientConfig] = None,
    profile_owner: Optional[AccountId] = None,
) -> SignPayloadResponse

Signs a binary payload and returns a signature envelope.

Parameters:

  • profile_name (ProfileName) –

    The name of the signing profile.

  • profile_owner (Optional[AccountId], default: None ) –

    The AWS account ID of the profile owner.

  • payload (Payload) –

    Specifies the object digest (hash) to sign.

  • payload_format (String) –

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

Raises:

Source code in docs_src/capo_signer/_services/signer.py
def sign_payload(
    self,
    profile_name: "capo_signer.types.profile_name.ProfileName",
    payload: "capo_signer.types.payload.Payload",
    payload_format: "capo_signer.types.string.String",
    *,
    config_overrides: Optional[signerClientConfig] = None,
    profile_owner: Optional["capo_signer.types.account_id.AccountId"] = None,
) -> "capo_signer.types.sign_payload_response.SignPayloadResponse":
    """<p>Signs a binary payload and returns a signature envelope.</p>

    Args:
        profile_name: <p>The name of the signing profile.</p>
        profile_owner: <p>The AWS account ID of the profile owner.</p>
        payload: <p>Specifies the object digest (hash) to sign.</p>
        payload_format: <p>Payload content type. The single valid type is <code>application/vnd.cncf.notary.payload.v1+json</code>.</p>

    Raises:
        capo_signer.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_signer.errors.internal_service_error_exception.InternalServiceErrorException: <p>An internal error occurred.</p>
        capo_signer.errors.resource_not_found_exception.ResourceNotFoundException: <p>A specified resource could not be found.</p>
        capo_signer.errors.too_many_requests_exception.TooManyRequestsException: <p>The allowed number of job-signing requests has been exceeded.</p> <p>This error supersedes the error <code>ThrottlingException</code>.</p>
        capo_signer.errors.validation_exception.ValidationException: <p>You signing certificate could not be validated.</p>
        capo_signer.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_signer.types.sign_payload_request.SignPayloadRequest]",
    ) -> OperationResponse[
        "capo_signer.types.sign_payload_response.SignPayloadResponse"
    ]:
        import capo_signer._operations.wallaby_service.sign_payload

        output, http_response = (
            capo_signer._operations.wallaby_service.sign_payload.sign_payload(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SignPayload")
    )
    input_: capo_signer.types.sign_payload_request.SignPayloadRequest = {
        "profile_name": profile_name,
        "payload": payload,
        "payload_format": payload_format,
    }
    if profile_owner is not None:
        input_["profile_owner"] = profile_owner

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output