A SignResponse hash as returned by the u2f.sign JavaScript API.

 challenge - The challenge to sign.

 Returns a JSON encoded Hash String.
352891
def sign_response(challenge)
      client_data_json = client_data(::U2F::ClientData::AUTHENTICATION_TYP, challenge)
      JSON.dump(
        clientData: ::U2F.urlsafe_encode64(client_data_json),
        keyHandle: ::U2F.urlsafe_encode64(key_handle_raw),
        signatureData: auth_signature_data(client_data_json)
      )
    end
843242
def str_to_hash
        client = RestClient.where(:api_key => @http_headers[@@header_api_key]).first
        if client.nil?
          @errors << "client is not registered"
        end
        client.nil? ? "" : client.secret + @request_uri.gsub( /\?.*/, "" ) + @http_headers[@@header_timestamp]
      end
489416
def sign_message(payload, private_key)
      signature_urlencoded = ''

      key = OpenSSL::PKey::RSA.new(private_key)

      payload_decoded = CGI::unescape(payload.chomp('decode'))

      signature = key.sign(OpenSSL::Digest::MD5.new, payload_decoded)
      signature_base64 = Base64.strict_encode64(signature)
      signature_urlencoded = "#{CGI::escape(signature_base64)}decode"

      return signature_urlencoded
    end
538229
async function challengeCreateFn(authz, challenge, keyAuthorization) {
    /* Do something here */
    log(JSON.stringify(authz));
    log(JSON.stringify(challenge));
    log(keyAuthorization);
}
445091
def get_signature_challenge(self):
        """"""

        devices = [DeviceRegistration.wrap(device) for device in self.__get_u2f_devices()]

        if devices == []:
            return {
                'status' : 'failed', 
                'error'  : 'No devices been associated with the account!'
            }

        challenge = start_authenticate(devices)
        challenge['status'] = 'ok'

        session['_u2f_challenge_'] = challenge.json

        return challenge
531431
def request_signature(self, stringtosign):
        
        digest = hmac.new(
            self.secret_key.encode(ENCODING),
            stringtosign.encode(ENCODING),
            hashlib.sha1
        ).digest()
        return b64_string(digest)
710597
def encode(self, payload):
        
        token = jwt.encode(payload, self.signing_key, algorithm=self.algorithm)
        return token.decode('utf-8')
114402
def challenge_response(self, challenge, mode='HMAC', slot=1, variable=True, may_block=True):
        
        if not self.capabilities.have_challenge_response(mode):
            raise yubikey_base.YubiKeyVersionError("%s challenge-response unsupported in YubiKey %s" % (mode, self.version()) )
        return self._challenge_response(challenge, mode, slot, variable, may_block)
853132
def sign(self, payload):
        
        if self.authenticator:
            return self.authenticator.signed(payload)
        return payload
741208
def certificates
      return Hash[self.signs.map{|path, sign| [path, sign.certificates.first] }]
    end
357372
def sign(self, msg, key):
        
        hasher = hashes.Hash(self.hash_algorithm(), backend=default_backend())
        hasher.update(msg)
        digest = hasher.finalize()
        sig = key.sign(
            digest,
            padding.PSS(
                mgf=padding.MGF1(self.hash_algorithm()),
                salt_length=padding.PSS.MAX_LENGTH),
            utils.Prehashed(self.hash_algorithm()))
        return sig
800584
def challenge_auth(username, password, challenge, lower, digest='sha256'):
    
    def hdig(x):
        return fdigest(x).hexdigest()

    fdigest = get_digest(digest)
    luser = lower(username)
    tpass = password[:10].encode("ascii")
    hvalue = hdig("{0}:{1}".format(luser, hdig(tpass)).encode("ascii"))
    bhvalue = hvalue.encode("ascii")
    bchallenge = challenge.encode("ascii")
    return hmac.HMAC(bhvalue, bchallenge, digestmod=fdigest).hexdigest()
241145
def sign(jwk, jws = nil, header = nil)
      plain_text = to_binary
      if jws.nil?
        jwk = JOSE::JWK.from(jwk)
        jws = jwk.signer
      end
      jws = JOSE::JWS.from(jws).to_map
      if not jws.has_key?('typ')
        jws = jws.put('typ', 'JWT')
      end
      return JOSE::JWK.sign(plain_text, jws, jwk, header)
    end
17704
def generate_nt_response_mschap2(authenticator_challenge, peer_challenge, username, password):
    """"""
    challenge = challenge_hash(peer_challenge, authenticator_challenge, username)
    password_hash = nt_password_hash(password)
    return challenge_response(challenge, password_hash)
308744
def sign(time)
      unencrypted_signature = @api_key + @secret + time + @user.to_s
      to_digest = unencrypted_signature + unencrypted_signature.length.to_s
      return Digest::MD5.hexdigest(to_digest)
    end
1066787
def reg_signature(client_data_json)
      payload = [
        "\x00",
        ::U2F::DIGEST.digest(app_id),
        ::U2F::DIGEST.digest(client_data_json),
        key_handle_raw,
        origin_public_key_raw
      ].join
      cert_key.sign(::U2F::DIGEST.new, payload)
    end
1018991
def token_from_response(self, responseJson):
    
    token = responseJson['data'][0]['token']
    facade = responseJson['data'][0]['facade']
    return {facade: token}
    raise BitPayBitPayError('%(code)d: %(message)s' % {'code': response.status_code, 'message': response.json()['error']})