Neos\Flow\Security\Cryptography\RsaWalletServicePhp::registerPublicKeyFromString PHP Метод

registerPublicKeyFromString() публичный Метод

This is helpful if you have not private key and want to use this key only to verify incoming data.
public registerPublicKeyFromString ( string $publicKeyString ) : string
$publicKeyString string The public key in its string representation
Результат string The RSA public key fingerprint for reference
    public function registerPublicKeyFromString($publicKeyString)
    {
        $keyResource = openssl_pkey_get_public($publicKeyString);
        $modulus = $this->getModulus($keyResource);
        $publicKey = new OpenSslRsaKey($modulus, $publicKeyString);
        return $this->storeKeyPair($publicKey, null, false);
    }

Usage Example

    /**
     * @test
     */
    public function registerPublicKeyFromStringUsesFingerprintAsUuid()
    {
        $keyString = '-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDP7ZWzP/6x3SXyt0Al9UvyCe8D
TG6y1t7ovmWGw+D2x4BtZfbEHtNhlWHFkLLXzGKdgmzm4WjSB1fWQ1lfu5L8wY+g
HofCDIScx7AMgIB7hRB9ZMDEyWN/1vgSm8+4K4jUcD6OGLJYTSAlaQ7e2ZGaAY5h
p2P76gIh+wUlPjsr/QIDAQAB
-----END PUBLIC KEY-----';
        $this->assertEquals('cfa6879e3dfcf709db4cfd8e61fdd782', $this->rsaWalletService->registerPublicKeyFromString($keyString));
    }
All Usage Examples Of Neos\Flow\Security\Cryptography\RsaWalletServicePhp::registerPublicKeyFromString