Adds a password to a master key.
@param $mkey A master key.
@param $pwd A text password.
@return true if the operation succeeded, false otherwise.
777320
public static function addPassword(CompositeKey $mkey, $pwd)
	{
		$mkey->addKey(self::keyFromPassword($pwd));
		return true;
	}
1001275
public synchronized void
addTrustedKey(DNSKEYRecord key) {
	Name name = key.getName();
	List list = (List) trustedKeys.get(name);
	if (list == null)
		trustedKeys.put(name, list = new LinkedList());
	list.add(key);
}
1082894
public static function Set($sKey, $mValue){
            $oThis = self::CreateInstanceIfNotExists();

            if($oThis->bStarted){
                if($sKey != "name" && $sKey != "id" && $sKey != "authentication"){
                    $_SESSION[$oThis->sName][$sKey] = $mValue;
                    return true;
                }
                else{
                    return false;
                }
            }
            else{
                return false;
            }
        }
1173430
public function addKey(PKEncryptionEnabledUserInterface $user, $encryptedKey)
    {
        $userClass = $this->getUserClass($user);
        $userId = $user->getId();
        if (!isset($this->encryptedKeys[$userClass])) {
            $this->encryptedKeys[$userClass] = array();
        }
        $this->encryptedKeys[$userClass][$userId] = $encryptedKey;
    }
1265383
public function unlock($passphrase, $timeout)
    {
        $args = [
            (string)$passphrase,
            (int)$timeout
        ];
        
        try {
            $this->rpc->query("walletPassPhrase", $args);
        } catch (Exceptions\RPCException $e) {
            if ($e->getCode() != RPCErrorCodes::WALLET_ALREADY_UNLOCKED) {
                throw $e;
            }
        }
        
        return true;
    }
1335520
def accept_key(pki_dir, pub, id_):
    '''
    
    '''
    for key_dir in 'minions', 'minions_pre', 'minions_rejected':
        key_path = os.path.join(pki_dir, key_dir)
        if not os.path.exists(key_path):
            os.makedirs(key_path)

    key = os.path.join(pki_dir, 'minions', id_)
    with salt.utils.files.fopen(key, 'w+') as fp_:
        fp_.write(salt.utils.stringutils.to_str(pub))

    oldkey = os.path.join(pki_dir, 'minions_pre', id_)
    if os.path.isfile(oldkey):
        with salt.utils.files.fopen(oldkey) as fp_:
            if fp_.read() == pub:
                os.remove(oldkey)
1299805
public void addPasswordProperty(String strProperty)
    {
        if (m_setPropertiesDescriptions == null)
            m_setPropertiesDescriptions = new HashSet<String>();
        if (strProperty != null)
            m_setPropertiesDescriptions.add(strProperty);
        else
            m_setPropertiesDescriptions.remove(strProperty);
    }
1012303
function cmd_PWD($fd, $cmd)
    {
        $user = $this->getUser($fd);
        $this->send($fd, "257 \"" . $this->getUserDir($user) . "\" is your current location");
    }
472817
protected function setCache($sKey, $mValue)
    {
        if (!static::$CACHING_ENABLED) {
            return false;
        } elseif (empty($sKey)) {
            return false;
        }

        // --------------------------------------------------------------------------

        //  Test we're not near memory limit
        if (function_exists('ini_get')) {
            $sMemoryLimit = ini_get('memory_limit_cat');
            if ($sMemoryLimit !== false) {
                $sLastChar = strtoupper($sMemoryLimit[strlen($sMemoryLimit) - 1]);
                switch ($sLastChar) {
                    // The 'G' modifier is available since PHP 5.1.0
                    case 'G':
                        $sMemoryLimit *= 1024;
                    /* falls through */
                    case 'M':
                        $sMemoryLimit *= 1024;
                    /* falls through */
                    case 'K':
                        $sMemoryLimit *= 1024;
                }

                $fPercentage = (memory_get_usage() / $sMemoryLimit) * 100;
                if ($fPercentage > 90) {
                    $this->clearCache();
                }
            }
        }

        // --------------------------------------------------------------------------

        //  Prep the key, the key should have a prefix unique to this model
        $iCacheIndex = $this->getCache($sKey, false);
        if (!is_null($iCacheIndex)) {
            $this->aCache[$iCacheIndex]->value = $mValue;
        } else {
            $sCacheKey      = $this->getCachePrefix() . $sKey;
            $this->aCache[] = (object) [
                'key'   => [$sCacheKey],
                'value' => $mValue,
            ];
        }

        // --------------------------------------------------------------------------

        return true;
    }
439964
public KeyStoreCredentialResolverBuilder addKeyPasswords(Map<String, String> keyPasswords) {
        requireNonNull(keyPasswords, "keyPasswords");
        keyPasswords.forEach(this::addKeyPassword);
        return this;
    }
780682
public static mps_ssl_certkey add(nitro_service client, mps_ssl_certkey resource) throws Exception
	{
		resource.validate("add");
		return ((mps_ssl_certkey[]) resource.perform_operation(client, "add"))[0];
	}
1147508
public function checkPassword($password, $hash)
    {
        if ($this->mode == self::MODE_BCRYPT) {
            return $this->checkModeBcrypt($password, $hash);
        } elseif ($this->mode == self::MODE_PBKDF2) {
            return $this->checkModePbkdf2($password, $hash);
        }

        $this->error = 'You have to set the mode...';
        $this->cwsDebug->error($this->error);

        return false;
    }
1263323
public static function createFromKey(string $key, ?string $password = null, array $additional_values = []): JWK
    {
        $values = KeyConverter::loadFromKey($key, $password);
        $values = \array_merge($values, $additional_values);

        return JWK::create($values);
    }
980151
private static char[] getPassword(TextDevice textDevice, String key) {
        boolean noMatch;
        char[] cred = new char[0];
        char[] passwd1;
        char[] passwd2;
        do {
            passwd1 = textDevice.readPassword("Please enter the password value for %s:", key);
            passwd2 = textDevice.readPassword("Please enter the password value for %s again:", key);
            noMatch = !Arrays.equals(passwd1, passwd2);
            if (noMatch) {
                if (passwd1 != null) {
                    Arrays.fill(passwd1, ' ');
                }
                textDevice.printf("Password entries don't match. Please try again.\n");
            } else {
                if (passwd1.length == 0) {
                    textDevice.printf("An empty password is not valid.  Please try again.\n");
                    noMatch = true;
                } else {
                    cred = passwd1;
                }
            }
            if (passwd2 != null) {
                Arrays.fill(passwd2, ' ');
            }
        } while (noMatch);
        return cred;
    }
101046
public static function checkKphpDBPassword($dbid, $kphpdbPwd)
	{
		if(!self::$_started)
		{
			self::addDebug("KeepassPHP is not started!");
			return false;
		}
		try
		{
			$kphpdb = self::openKphpDB($dbid, $kphpdbPwd);
			return true;
		}
		catch(KeePassPHPException $e)
		{
			self::raiseError($e);
			return false;
		}
	}
1134632
public static KeyPair loadKey(String pemString, String passwd) throws IOException, GeneralSecurityException {
        return PrivateKeyProvider.loadKey(pemString, passwd);
    }
399741
function set_login( $uname = '', $passwd = '' )
    {
        if ( strlen($uname) > 0 )
        {
            $this->remote_uname = $uname;
        }

        if ( strlen($passwd) > 0 )
        {
            $this->remote_passwd = $passwd;
        }

    }