public destroyKeypair ( string $fingerprint ) : void | ||
$fingerprint | string | The fingerprint |
Résultat | void |
public function destroyKeypair($fingerprint)
{
if ($fingerprint === null || !isset($this->keys[$fingerprint])) {
throw new InvalidKeyPairIdException('Invalid keypair fingerprint given', 1231438863);
}
unset($this->keys[$fingerprint]);
$this->saveKeysOnShutdown = true;
}
/** * @test */ public function shutdownSavesKeysToKeystoreFileIfKeysWereModified() { $this->assertFalse(file_exists('vfs://Foo/EncryptionKey')); $keyPairUuid = $this->rsaWalletService->generateNewKeypair(true); $this->rsaWalletService->shutdownObject(); $this->assertTrue(file_exists('vfs://Foo/EncryptionKey')); $this->rsaWalletService->destroyKeypair($keyPairUuid); $this->rsaWalletService->initializeObject(); $this->rsaWalletService->getPublicKey($keyPairUuid); }