public function getPublicKey($fingerprint) { if ($fingerprint === null || !isset($this->keys[$fingerprint])) { throw new InvalidKeyPairIdException('Invalid keypair fingerprint given', 1231438860); } return $this->keys[$fingerprint]['publicKey']; }
/** * @test */ public function shutdownDoesNotSavesKeysToKeystoreFileIfKeysWereNotModified() { $this->assertFalse(file_exists('vfs://Foo/EncryptionKey')); $keyPairUuid = $this->rsaWalletService->generateNewKeypair(true); $this->rsaWalletService->shutdownObject(); $this->assertTrue(file_exists('vfs://Foo/EncryptionKey')); $this->rsaWalletService->initializeObject(); $this->rsaWalletService->getPublicKey($keyPairUuid); // Hack: remove the file so we can actually detect if shutdown() would write it: unlink('vfs://Foo/EncryptionKey'); $this->rsaWalletService->shutdownObject(); $this->assertFalse(file_exists('vfs://Foo/EncryptionKey')); }