class PrivateKeyManagerImpl extends KeyManagerImpl<PrimitiveT, KeyProtoT> implements PrivateKeyManager<PrimitiveT> {

  @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);
    }
  }

  public  PrivateKeyManagerImpl(
      PrivateKeyTypeManager<KeyProtoT, PublicKeyProtoT> privateKeyManager,
      KeyTypeManager<PublicKeyProtoT> publicKeyManager,
      Class<PrimitiveT> primitiveClass);

}