def start_with_webpki
            if @pdf_content_base64.to_s.blank?
                raise 'The PDF to sign was not set'
            end
            if @signature_policy_id.to_s.blank?
                raise 'The signature policy was not set'
            end

            request = {
                securityContextId: @security_context_id,
                pdfToSign: @pdf_content_base64,
                signaturePolicyId: @signature_policy_id,
                callbackArgument: @callback_argument,
                visualRepresentation: @visual_representation,
                ignoreRevocationStatusUnknown: @ignore_revocation_status_unknown
            }
            unless @signer_certificate_base64.to_s.blank?
                request['certificate'] = Base64.encode64(@signer_certificate_base64)
            end

            response = @restpki_client.post('Api/PadesSignatures', request, 'pades_model')

            unless response['certificate'].nil?
                @certificate = response['certificate']
            end
            @done = true

            response['token']
        end
def start_with_webpki
            if @pdf_content_base64.to_s.blank?
                raise 'The PDF to sign was not set'
            end
            if @signature_policy_id.to_s.blank?
                raise 'The signature policy was not set'
            end

            request = {
                securityContextId: @security_context_id,
                pdfToSign: @pdf_content_base64,
                signaturePolicyId: @signature_policy_id,
                callbackArgument: @callback_argument,
                visualRepresentation: @visual_representation,
                ignoreRevocationStatusUnknown: @ignore_revocation_status_unknown
            }
            unless @signer_certificate_base64.to_s.blank?
                request['certificate'] = Base64.encode64(@signer_certificate_base64)
            end

            response = @restpki_client.post('Api/PadesSignatures', request, 'pades_model')

            unless response['certificate'].nil?
                @certificate = response['certificate']
            end
            @done = true

            response['token']
        end
endregion