### Question:
RsaEcdsaEncrypterManager extends EncrypterManager { @Override HybridEncrypt rawLoadPublicKey(byte[] publicKey) throws GeneralSecurityException { WrappedRsaEcdsaPublicKey wrappedRsaEcdsaPublicKey; try { wrappedRsaEcdsaPublicKey = WrappedRsaEcdsaPublicKey.parseFrom(publicKey); } catch (InvalidProtocolBufferException e) { throw new GeneralSecurityException("unable to parse public key", e); } PublicKey recipientPublicKey = KeyFactory.getInstance("RSA").generatePublic( new X509EncodedKeySpec(wrappedRsaEcdsaPublicKey.getKeyBytes().toByteArray())); return new RsaEcdsaHybridEncrypt.Builder() .withSenderSigner(senderSigner) .withRecipientPublicKey(recipientPublicKey) .withPadding(RsaEcdsaConstants.Padding.valueOf(wrappedRsaEcdsaPublicKey.getPadding())) .build(); } RsaEcdsaEncrypterManager(InputStream senderSigningKey);   }### 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[] testRsaPublicKey = TestUtils.getBytes("rsa_public_key.dat"); byte[] rawPublicKey = WrappedRsaEcdsaPublicKey.newBuilder() .setPadding(Padding.OAEP.name()) .setKeyBytes(ByteString.copyFrom(testRsaPublicKey)) .build().toByteArray(); encrypterManager.rawLoadPublicKey(rawPublicKey); }