Adds an input that points to the given output and contains a valid signature for it, calculated using the
signing key.
422754
public TransactionInput addSignedInput(TransactionOutput output, ECKey signingKey) {
        return addSignedInput(output.getOutPointFor(), output.getScriptPubKey(), signingKey);
    }
157975
private V putImpl(K key, V value)
  {
    V item = null;

    int hash = key.hashCode() & _mask;
    int count = _values.length;

    for (; count > 0; count--) {
      item = _values[hash];

      // No matching item, so create one
      if (item == null) {
        _keys[hash] = key;
        _values[hash] = value;
        _size++;

        return null;
      }

      // matching item gets replaced
      if (_keys[hash].equals(key)) {
        _values[hash] = value;

        return item;
      }

      hash = (hash + 1) & _mask;
    }

    throw new IllegalStateException();
  }
1241570
def sign(self, data):
        
        if self.signing_key is None:
            raise MissingSigningKeyError("KeyPair does not contain secret key. "
                                         "Use Keypair.from_seed method to create a new keypair with a secret key.")
        return self.signing_key.sign(data)
393182
function (input, signature, b64safeKey, alg) {
  var key = new Buffer( b64url.b64( b64safeKey ), 'base64' )
  var hmac = crypto.createHmac( alg, key ).update( input )
  var inputSignature = b64url.safe( hmac.digest( 'base64' ) )
  return (inputSignature === signature)
}
995753
public TaskResult addOutputData(String key, Object value) {
        this.outputData.put(key, value);
        return this;
    }
1304682
void signedSubtract(MutableBigInteger addend) {
        if (sign == 1)
            sign = sign * subtract(addend);
        else
            add(addend);
        if (intLen == 0)
             sign = 1;
    }
365505
def sign_all_unsigned_inputs(hex_privkey, unsigned_tx_hex):
    
    inputs, outputs, locktime, version = deserialize_transaction(unsigned_tx_hex)
    tx_hex = unsigned_tx_hex
    for index in xrange(0, len(inputs)):
        if len(inputs[index]['script_sig']) == 0:

            # tx with index i signed with privkey
            tx_hex = sign_transaction(str(unsigned_tx_hex), index, hex_privkey)
            unsigned_tx_hex = tx_hex

    return tx_hex
1221478
function objectToSignature(source) {
  function sortObject(input) {
      if(typeof input !== 'object' ||input===null)
          return input
      var output = {};
       Object.keys(input).sort().forEach(function (key) {
        output[key] = sortObject(input[key]);
      });
      return output;
  }
  var signature={};
  //
  // what about transactions and transfers ??
  // FIXME append 'amount_negative',
  ['balance','card','id','wid','email','apikey'].forEach(function (key) {
    signature[key]=source[key];
  });

  return sortObject(signature);
}
1283167
function addIssueInput(serial_number){
			total_amount += issue_amount;
			var input = {
				type: "issue",
				amount: issue_amount,
				serial_number: serial_number
			};
			if (bMultiAuthored)
				input.address = issuer_address;
			var objInputWithProof = {input: input};
			if (objAsset && objAsset.is_private){
				var spend_proof = objectHash.getBase64Hash({
					asset: asset,
					amount: issue_amount,
					denomination: 1,
					address: issuer_address,
					serial_number: serial_number
				});
				var objSpendProof = {spend_proof: spend_proof};
				if (bMultiAuthored)
					objSpendProof.address = input.address;
				objInputWithProof.spend_proof = objSpendProof;
			}
			arrInputsWithProofs.push(objInputWithProof);
			var bFound = is_base ? (total_amount > required_amount) : (total_amount >= required_amount);
			bFound ? onDone(arrInputsWithProofs, total_amount) : finish();
		}
720276
def add_input(self, line):
        
        Deployment.objects.filter(pk=self.id).update(input=CF('input')+line)
151006
public TransactionInput addSignedInput(TransactionOutput output, ECKey signingKey, SigHash sigHash, boolean anyoneCanPay) {
        return addSignedInput(output.getOutPointFor(), output.getScriptPubKey(), signingKey, sigHash, anyoneCanPay);
    }
287085
def add_tokens_for_single(self, ignore=False):
        """"""
        args = self.single.args
        name = self.single.python_name

        # Reset indentation to proper amount and add signature
        self.reset_indentation(self.indent_type * self.single.indent)
        self.result.extend(self.tokens.make_single(name, args))

        # Add skip if necessary
        if ignore:
            self.single.skipped = True
            self.result.extend(self.tokens.test_skip)

        self.groups.finish_signature()
1363816
function( signature, input, key ) {

    var verifier = crypto.createVerify( this.algorithm + this.bits )

    return verifier.update( input )
      .verify( key, signature )

  }
1344548
private void updateInitSignature(int idx, State<O> succ, O out) {
        StateSignature<O> sig = init.getSignature();
        State<O> oldSucc = sig.successors.array[idx];
        if (oldSucc == succ && Objects.equals(out, sig.outputs.array[idx])) {
            return;
        }
        if (oldSucc != null) {
            oldSucc.decreaseIncoming();
        }
        sig.successors.array[idx] = succ;
        sig.outputs.array[idx] = out;
        succ.increaseIncoming();
    }
184074
public KeyVerifyParameters withSignature(byte[] signature) {
        if (signature == null) {
            this.signature = null;
        } else {
            this.signature = Base64Url.encode(signature);
        }
        return this;
    }
1221233
def sign_data(args):
    
    sk = _load_ecdsa_signing_key(args)

    # calculate signature of binary data
    binary_content = args.datafile.read()
    signature = sk.sign_deterministic(binary_content, hashlib.sha256)

    # back-verify signature
    vk = sk.get_verifying_key()
    vk.verify(signature, binary_content, hashlib.sha256)  # throws exception on failure

    if args.output is None or os.path.abspath(args.output) == os.path.abspath(args.datafile.name):  # append signature to input file
        args.datafile.close()
        outfile = open(args.datafile.name, "ab")
    else:  # write file & signature to new file
        outfile = open(args.output, "wb")
        outfile.write(binary_content)
    outfile.write(struct.pack("I", 0))  # Version indicator, allow for different curves/formats later
    outfile.write(signature)
    outfile.close()
    print("Signed %d bytes of data from %s with key %s" % (len(binary_content), args.datafile.name, args.keyfile.name))
860788
def sign(key, qs):
    """"""
    sig = derive_signature(key, qs)
    return "%s&%s" % (qs, urlencode([("sig", sig)]))