Create array of short names and values for Certificate Signing Request subjects

@private
@param {object} subjectObj Key-value of short names and values
@returns {object[]} Certificate Signing Request subject array
517204
function createCsrSubject(subjectObj) {
    return Object.entries(subjectObj).reduce((result, [shortName, value]) => {
        if (value) {
            result.push({ shortName, value });
        }

        return result;
    }, []);
}
1213283
function objectKeys(obj) {
  if (!obj) { return null; }

  if (Object.keys) {
    return Object.keys(obj);
  }

  var out = [];

  for (var key in obj) {
    if (obj.hasOwnProperty(key)) {
      out.push(key);
    }
  }

  return out;
}
1249839
@POST
    @Path("{id}/migrate")
    public CreateEmoApiKeyResponse migrateApiKey(@PathParam("id") String id, @QueryParam("key") String key,
                                                 @Authenticated Subject subject) {
        MigrateEmoApiKeyRequest request = new MigrateEmoApiKeyRequest(id);
        if (key != null) {
            request.setCustomRequestParameter("key", key);
        }
        String newKey = _uac.migrateApiKey(subject, request);
        // Even though we're technically not creating a new API key the response object is the same
        return new CreateEmoApiKeyResponse(newKey, id);
    }
451031
function listToObject(list, key) {
        var length, result, i, obj, keyValue;
        if (!list) {
            list = [];
        }
        length = list.length;
        result = { valids: {}, discarded: [] };
        for (i = 0; i < length; i += 1) {
            obj = list[i];
            keyValue = obj[key];
            // discard the object without a key
            if (keyValue) {
                result.valids[keyValue] = obj;
            } else {
                result.discarded.push(obj);
            }
        }
        return result;
    }
690717
@Override
    public EmoApiKey getApiKey(Subject subject, String id) {
        // Every user has implicit permission to view herself
        if (!subject.getId().equals(id)) {
            verifyPermission(subject, Permissions.readApiKey());
        }
        ApiKey apiKey = _authIdentityManager.getIdentity(id);
        if (apiKey == null) {
            throw new EmoApiKeyNotFoundException();
        }
        return convert(apiKey);
    }
1088981
@Override
	public String getCacheKeyForJwtSSOToken(Subject subject, String encodedjwt) {
		// TODO Auto-generated method stub
		if (encodedjwt != null) {
			return HashUtils.digest(encodedjwt);
		} else if (subject != null) {
			String jwtssotoken = getJwtSSOToken(subject);
			if (jwtssotoken != null) {
				return HashUtils.digest(jwtssotoken);
			}
		}

		return null;
	}
235398
public function decodeSignedJsonRequest(
        RequestInterface $request,
        SigningPublicKey $publicKey
    ): array {
        /** @var array|bool $array */
        $array = \json_decode(
            $this->verifySignedStringRequest($request, $publicKey),
            true
        );
        if (!\is_array($array)) {
            throw new InvalidMessageException('Could not decode JSON');
        }
        return $array;
    }
828401
def [](key)
      key = CF::String.from_string(key) if key.is_a?(::String)
      self.class.check_cftype(key)
      raw = CF.CFDictionaryGetValue(self, key)
      raw.null? ? nil : self.class.typecast(raw).retain.release_on_gc
    end
65463
function(apiKey, templateId, pieceTitle,
        category, fromAddress, toAddress, ccAddress, bccAddresses, subject,
        textBody, htmlBody, contentType, mergeContext) {}
920360
function getObjectWithKeyAsCjs(key, object) {
	const jsContents = Object.keys(object).reduce((jsLines, name) => {
		jsLines.push(`\t\t'${escapeForJS(name)}': '${escapeForJS(object[name])}'`);

		return jsLines;
	}, []).join(',\n');
	const cjs = `\n\t${key}: {\n${jsContents}\n\t}`;

	return cjs;
}
1134366
def create_public_key_from_json(values):
        """"""
        # currently we only support RSA public keys
        _id = values.get('id')
        if not _id:
            # Make it more forgiving for now.
            _id = ''
            # raise ValueError('publicKey definition is missing the "id" value.')

        if values.get('type') == PUBLIC_KEY_TYPE_RSA:
            public_key = PublicKeyRSA(_id, owner=values.get('owner'))
        else:
            public_key = PublicKeyBase(_id, owner=values.get('owner'), type='EthereumECDSAKey')

        public_key.set_key_value(values)
        return public_key
1063506
function( keys ) {
		var lookupString = keys.toString();
		var id = this.plainObjectSignatureLookup[lookupString];			
		if (id === undefined) {

			// Create new signature buffer
			var sigbuf = [];
			sigbuf.push( pack2b( keys.length, false ) );
			for (var i=0, l=keys.length; i<l; ++i) {
				sigbuf.push( pack2b( this.stringID(keys[i]), false ) );
			}

			// Keep on table
			this.plainObjectSignatureTable.push( Buffer.concat( sigbuf ) );
			this.plainObjectSignatureLookup[lookupString] 
				= id = this.plainObjectSignatureTable.length - 1;

		}
		return id;
	}
16739
function srandmember(key /* count, req */) {
  var args = slice.call(arguments, 1)
    , req = typeof args[args.length-1] === 'object' ? args.pop() : null
    , val = this.getKey(key, req);
  if(val === undefined) {
    return args[0] === undefined ? null : [];
  }
  return val.srandmember(args[0]);
}
118890
function parseDomains(cert) {
    const altNames = [];
    let commonName = null;
    const commonNameMatch = cert.match(/Subject:.*? CN\s?=\s?([^\s,;/]+)/);
    const altNamesMatch = cert.match(/X509v3 Subject Alternative Name:\s?\n\s*([^\n]+)\n/);

    /* Subject common name */
    if (commonNameMatch) {
        commonName = commonNameMatch[1];
    }

    /* Alternative names */
    if (altNamesMatch) {
        altNamesMatch[1].split(/,\s*/).forEach((altName) => {
            if (altName.match(/^DNS:/)) {
                altNames.push(altName.replace(/^DNS:/, ''));
            }
        });
    }

    return {
        commonName,
        altNames
    };
}
1058655
function baseKeysIn$1(object) {
  if (!isObject$4(object)) {
    return nativeKeysIn(object);
  }
  var isProto = isPrototype$2(object),
      result = [];

  for (var key in object) {
    if (!(key == 'constructor' && (isProto || !hasOwnProperty$8.call(object, key)))) {
      result.push(key);
    }
  }
  return result;
}
800758
function objectKeys(target, pred) {
  pred = pred || has;
  var results = [];


  for (var key in target) {
    if (pred(target, key)) {
      results.push(String(key));
    }
  }

  return results;
}
1009149
static public Object getByIdentity(Object[] array, Object key)
    {
        if (array != null)
        {
            int length = array.length;
            for (int i = 0; i < length; i += 2)
            {
                if (array[i] == key)
                {
                    return array[i + 1];
                }
            }
        }

        return null;
    }