Build a credential store with the given parameters.
333806
public CredentialStore buildCredentialStore(Map<String, Object> parameters) {
    String ks_type = EncryptionConfigParser.getKeystoreType(parameters);
    String ks_path = EncryptionConfigParser.getKeystorePath(parameters);
    String ks_password = EncryptionConfigParser.getKeystorePassword(parameters);

    try {
      switch (ks_type) {
        // TODO this is yet another example of building a broad type (CredentialStore) based on a human-readable name
        // (json) with a bag of parameters. Need to pull out into its own pattern!
        case JCEKSKeystoreCredentialStore.TAG:
          return new JCEKSKeystoreCredentialStore(ks_path, ks_password);
        case JsonCredentialStore.TAG:
          return new JsonCredentialStore(ks_path, buildKeyToStringCodec(parameters));
        default:
          return null;
      }
    } catch (IOException e) {
      log.error("Error building credential store, returning null", e);
      return null;
    }
  }
742969
function buildParams(msg, method, config, params) {
    var p = buildWorkspaceParams(msg, method, config, params)
      .then(function(){
        return buildIntentParams(msg, method, config, params);
      })
      .then(function(){
        return buildExampleParams(msg, method, config, params);
      })
      .then(function(){
        return buildEntityParams(msg, method, config, params);
      })
      .then(function(){
        return buildEntityValueParams(msg, method, config, params);
      })
      .then(function(){
        return buildDialogParams(msg, method, config, params);
      })
      .then(function(){
        return buildExportParams(method, config, params);
      });

    return p;
  }
61289
def cli(env, identifier):
    """"""

    mgr = SoftLayer.ObjectStorageManager(env.client)
    credential = mgr.create_credential(identifier)
    table = formatting.Table(['id', 'password', 'username', 'type_name'])
    table.sortby = 'id'
    table.add_row([
        credential['id'],
        credential['password'],
        credential['username'],
        credential['type']['name']
    ])

    env.fout(table)
751177
def build_configuration_parameters(app):
    """"""
    env = Environment(loader=FileSystemLoader("{0}/_data_templates".format(BASEPATH)))
    template_file = env.get_template("configuration-parameters.j2")
    data = {}
    data["schema"] = Config.schema()
    rendered_template = template_file.render(**data)
    output_dir = "{0}/configuration/generated".format(BASEPATH)
    with open("{}/parameters.rst".format(output_dir), "w") as f:
        f.write(rendered_template)
1260012
def build_resource_params
        parameters = permitted_params || params
        rparams = [parameters[resource_request_name] || parameters[resource_instance_name] || {}]
        if without_protection_given?
          rparams << without_protection
        else
          rparams << as_role if role_given?
        end

        rparams
      end
34632
def create_database(options) #:nodoc:
      options_pattern = {
        :database => :mandatory, :storage => :memory, :type => :document,
        :user => :optional, :password => :optional
      }
      verify_and_sanitize_options(options, options_pattern)
      verify_options(options.select {|k,v| k === :storage or k === :type}, {:storage => [:memory, :plocal], :type => [:document, :graph]})

      params = { :method => :post, :uri => "database/#{options[:database]}/#{options[:storage].to_s}/#{options[:type].to_s}" }
      params[:no_session] = true # out of existing session which represents an already done authentication

      # additional authentication allowed, overriden in 'call_server' if not defined
      params[:user] = options[:user] if options.include? :user
      params[:password] = options[:password] if options.include? :password

      response = call_server params
      process_response(response)
    end
984298
function (certparams) {
    var keys = forge.pki.rsa.generateKeyPair(2048);
    this.publicKey = keys.publicKey;
    this.privateKey = keys.privateKey;
    this.cert = this.createCertificate(certparams);
    this.keycred = null;
    this.digest = null;
}
484355
def set_basic_params(self, use_credentials=None, stats_server=None):
        
        self._set_aliased('use-credentials', use_credentials)
        self._set_aliased('router-stats', stats_server)

        return self
1087220
def read_credentials(self, credentials):
        
        self._items.clear()
        for key in credentials.get_key_names():
            value = credentials.get_as_nullable_string(key)
            self._items.append(CredentialParams.from_tuples([key, value]))
776093
def from_credentials(cls: Type[SigningKeyType], salt: Union[str, bytes], password: Union[str, bytes],
                         scrypt_params: Optional[ScryptParams] = None) -> SigningKeyType:
        
        if scrypt_params is None:
            scrypt_params = ScryptParams()

        salt = ensure_bytes(salt)
        password = ensure_bytes(password)
        seed = scrypt(password, salt, scrypt_params.N, scrypt_params.r, scrypt_params.p, scrypt_params.seed_length)

        return cls(seed)
471302
def SetCredentials(api_username,api_passwd):
	""""""
	global V2_API_USERNAME
	global V2_API_PASSWD
	global _V2_ENABLED
	_V2_ENABLED = True
	V2_API_USERNAME = api_username
	V2_API_PASSWD = api_passwd
25453
def write_credentials(self):
        
        c = self.get_credentials()
        return self.storage.write_credentials(
            credentials=c, profile=self.profile,
            cache_token=self.cache_token
        )
134543
def store(self, server, username, secret):
        
        data_input = json.dumps({
            'ServerURL': server,
            'Username': username,
            'Secret': secret
        }).encode('utf-8')
        return self._execute('store', data_input)
552421
private StandardCredentials createCredentials(@Nonnull String serverAPIUrl,
                                                  final StandardCredentials credentials) {
        URI serverUri = URI.create(defaultIfBlank(serverAPIUrl, GITHUB_URL));

        List<DomainSpecification> specifications = asList(
                new SchemeSpecification(serverUri.getScheme()),
                new HostnameSpecification(serverUri.getHost(), null)
        );

        final Domain domain = new Domain(serverUri.getHost(), "GitHub domain (autogenerated)", specifications);
        ACL.impersonate(ACL.SYSTEM, new Runnable() { // do it with system rights
            @Override
            public void run() {
                try {
                    new SystemCredentialsProvider.StoreImpl().addDomain(domain, credentials);
                } catch (IOException e) {
                    LOGGER.error("Can't add creds for domain", e);
                }
            }
        });

        return credentials;
    }
250527
def add_credential(rack_env, type, credential)
      Env.new(rack_env).tap do |env|
        env.credentials[type] = credential
      end.to_rack
    end
292248
static KeyStore buildKeyStore(X509Certificate[] certChain, PrivateKey key, char[] keyPasswordChars)
            throws KeyStoreException, NoSuchAlgorithmException,
                   CertificateException, IOException {
        KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
        ks.load(null, null);
        ks.setKeyEntry(ALIAS, key, keyPasswordChars, certChain);
        return ks;
    }
50515
protected function configure()
    {
        $this
            ->addArgument('stores', InputArgument::IS_ARRAY | InputArgument::REQUIRED,
                'A list of stores to re-encrypt.')
            ->addOption(
                'new-profile',
                null,
                InputOption::VALUE_REQUIRED,
                'The new profile the current data is encrypted with.',
                null
            )
            ->addOption(
                'offset',
                null,
                InputOption::VALUE_REQUIRED,
                'Starting record',
                0
            )
            ->addOption(
                'limit',
                null,
                InputOption::VALUE_REQUIRED,
                'Max records to process',
                null
            )
            ->addOption(
                'batch-size',
                null,
                InputOption::VALUE_REQUIRED,
                'Records per batch to process',
                1
            );
    }