test_class.file: java_src/src/test/java/com/google/crypto/tink/PrivateKeyManagerImplTest.java
test_class.identifier: PrivateKeyManagerImplTest
test_case.body: @Test
    public void getPublicKeyData_invalidPrivateKey_throws() throws Exception {
      TestPrivateKeyTypeManager privateManager = new TestPrivateKeyTypeManager();
      TestPublicKeyTypeManager publicManager = new TestPublicKeyTypeManager();
      PrivateKeyManager<Void> manager =
          new PrivateKeyManagerImpl<>(privateManager, publicManager, Void.class);
      Ed25519PrivateKey privateKey =
          Ed25519PrivateKey.newBuilder()
              .setPublicKey(
                  Ed25519PublicKey.newBuilder()
                      .setKeyValue(ByteString.copyFrom(Random.randBytes(32))))
              .setKeyValue(ByteString.copyFrom(Random.randBytes(33)))
              .build();
      ByteString privateKeyByteString = privateKey.toByteString();
      
      try {
        manager.getPublicKeyData(privateKeyByteString);
        fail();
      } catch (GeneralSecurityException e) {
        assertExceptionContains(e, "validateKey(Ed25519PrivateKey)");
      }
    }
test_case.class_method_signature: PrivateKeyManagerImplTest.getPublicKeyData_invalidPrivateKey_throws()
test_case.full_signature: @Test public void getPublicKeyData_invalidPrivateKey_throws()
test_case.identifier: getPublicKeyData_invalidPrivateKey_throws
test_case.invocations: build setKeyValue setPublicKey newBuilder setKeyValue newBuilder copyFrom randBytes copyFrom randBytes toByteString getPublicKeyData fail assertExceptionContains
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getPublicKeyData_invalidPrivateKey_throws()
focal_class.declarator: privateKeyManager
focal_class.modifier: private final
focal_class.original_string: private final PrivateKeyTypeManager<KeyProtoT, PublicKeyProtoT> privateKeyManager;
focal_class.type: PrivateKeyTypeManager<KeyProtoT, PublicKeyProtoT>
focal_class.var_name: privateKeyManager
focal_class.declarator: publicKeyManager
focal_class.modifier: private final
focal_class.original_string: private final KeyTypeManager<PublicKeyProtoT> publicKeyManager;
focal_class.type: KeyTypeManager<PublicKeyProtoT>
focal_class.var_name: publicKeyManager
focal_class.file: java_src/src/main/java/com/google/crypto/tink/PrivateKeyManagerImpl.java
focal_class.identifier: PrivateKeyManagerImpl
focal_class.interfaces: implements PrivateKeyManager<PrimitiveT>
focal_class.class_method_signature: PrivateKeyManagerImpl.PrivateKeyManagerImpl(
        PrivateKeyTypeManager<KeyProtoT, PublicKeyProtoT> privateKeyManager,
        KeyTypeManager<PublicKeyProtoT> publicKeyManager,
        Class<PrimitiveT> primitiveClass)
focal_class.full_signature: public  PrivateKeyManagerImpl(
        PrivateKeyTypeManager<KeyProtoT, PublicKeyProtoT> privateKeyManager,
        KeyTypeManager<PublicKeyProtoT> publicKeyManager,
        Class<PrimitiveT> primitiveClass)
focal_class.identifier: PrivateKeyManagerImpl
focal_class.modifiers: public
focal_class.parameters: (
        PrivateKeyTypeManager<KeyProtoT, PublicKeyProtoT> privateKeyManager,
        KeyTypeManager<PublicKeyProtoT> publicKeyManager,
        Class<PrimitiveT> primitiveClass)
focal_class.signature:  PrivateKeyManagerImpl(
        PrivateKeyTypeManager<KeyProtoT, PublicKeyProtoT> privateKeyManager,
        KeyTypeManager<PublicKeyProtoT> publicKeyManager,
        Class<PrimitiveT> primitiveClass)
focal_class.class_method_signature: PrivateKeyManagerImpl.getPublicKeyData(ByteString serializedKey)
focal_class.full_signature: @Override public KeyData getPublicKeyData(ByteString serializedKey)
focal_class.identifier: getPublicKeyData
focal_class.modifiers: @Override public
focal_class.parameters: (ByteString serializedKey)
focal_class.return: KeyData
focal_class.signature: KeyData getPublicKeyData(ByteString serializedKey)
focal_class.superclass: extends KeyManagerImpl<PrimitiveT, KeyProtoT>
focal_method.body: @Override
    public KeyData getPublicKeyData(ByteString serializedKey) throws GeneralSecurityException {
      try {
        KeyProtoT privKeyProto = privateKeyManager.parseKey(serializedKey);
        privateKeyManager.validateKey(privKeyProto);
        PublicKeyProtoT publicKeyProto = privateKeyManager.getPublicKey(privKeyProto);
        publicKeyManager.validateKey(publicKeyProto);
        return KeyData.newBuilder()
            .setTypeUrl(publicKeyManager.getKeyType())
            .setValue(publicKeyProto.toByteString())
            .setKeyMaterialType(publicKeyManager.keyMaterialType())
            .build();
      } catch (InvalidProtocolBufferException e) {
        throw new GeneralSecurityException("expected serialized proto of type ", e);
      }
    }
focal_method.class_method_signature: PrivateKeyManagerImpl.getPublicKeyData(ByteString serializedKey)
focal_method.full_signature: @Override public KeyData getPublicKeyData(ByteString serializedKey)
focal_method.identifier: getPublicKeyData
focal_method.invocations: parseKey validateKey getPublicKey validateKey build setKeyMaterialType setValue setTypeUrl newBuilder getKeyType toByteString keyMaterialType
focal_method.modifiers: @Override public
focal_method.parameters: (ByteString serializedKey)
focal_method.return: KeyData
focal_method.signature: KeyData getPublicKeyData(ByteString serializedKey)