public function registerKeyPairFromPrivateKeyString($privateKeyString, $usedForPasswords = false)
    {
        $keyResource = openssl_pkey_get_private($privateKeyString);

        $modulus = $this->getModulus($keyResource);
        $publicKeyString = $this->getPublicKeyString($keyResource);

        $privateKey = new OpenSslRsaKey($modulus, $privateKeyString);
        $publicKey = new OpenSslRsaKey($modulus, $publicKeyString);

        return $this->storeKeyPair($publicKey, $privateKey, $usedForPasswords);
    }
public function registerKeyPairFromPrivateKeyString($privateKeyString, $usedForPasswords = false)
    {
        $keyResource = openssl_pkey_get_private($privateKeyString);

        $modulus = $this->getModulus($keyResource);
        $publicKeyString = $this->getPublicKeyString($keyResource);

        $privateKey = new OpenSslRsaKey($modulus, $privateKeyString);
        $publicKey = new OpenSslRsaKey($modulus, $publicKeyString);

        return $this->storeKeyPair($publicKey, $privateKey, $usedForPasswords);
    }
public function registerKeyPairFromPrivateKeyString ( $ privateKeyString , $ usedForPasswords = false ) { $ keyResource = openssl_pkey_get_private ( $ privateKeyString ) ; $ modulus = $ this -> getModulus ( $ keyResource ) ; $ publicKeyString = $ this -> getPublicKeyString ( $ keyResource ) ; $ privateKey = new OpenSslRsaKey ( $ modulus , $ privateKeyString ) ; $ publicKey = new OpenSslRsaKey ( $ modulus , $ publicKeyString ) ; return $ this -> storeKeyPair ( $ publicKey , $ privateKey , $ usedForPasswords ) ; }
Adds the specified keypair to the local store and returns a fingerprint to refer to it.

@param string $privateKeyString The private key in its string representation
@param boolean $usedForPasswords true if this keypair should be used to encrypt passwords (then decryption won't be allowed!).
@return string The RSA public key fingerprint for reference
Adds the specified keypair to the local store and returns a fingerprint to refer to it .