### Question:
WebPushEncrypterManager extends EncrypterManager { @Override HybridEncrypt rawLoadPublicKey(byte[] publicKey) throws GeneralSecurityException { WrappedWebPushPublicKey wrappedWebPushPublicKey; try { wrappedWebPushPublicKey = WrappedWebPushPublicKey.parseFrom(publicKey); } catch (InvalidProtocolBufferException e) { throw new GeneralSecurityException("unable to parse public key", e); } return new WebPushHybridEncrypt.Builder() .withAuthSecret(wrappedWebPushPublicKey.getAuthSecret().toByteArray()) .withRecipientPublicKey(wrappedWebPushPublicKey.getKeyBytes().toByteArray()) .build(); }    }### Answer:
@Test public void testLoadMalformedRawPublicKey() { byte[] rawPublicKey = "malformed raw public key".getBytes(); try { encrypterManager.rawLoadPublicKey(rawPublicKey); fail("Did not throw GeneralSecurityException"); } catch (GeneralSecurityException e) { } }
@Test public void testLoadValidRawPublicKey() throws IOException, GeneralSecurityException { byte[] authSecret = Random.randBytes(16); byte[] ecPublicKeyBytes = TestUtils.getBytes("ec_public_key.dat"); byte[] rawPublicKey = WrappedWebPushPublicKey.newBuilder() .setAuthSecret(ByteString.copyFrom(authSecret)) .setKeyBytes(ByteString.copyFrom(ecPublicKeyBytes)) .build().toByteArray(); encrypterManager.rawLoadPublicKey(rawPublicKey); }